Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59773 - in sandbox/geometry: boost/geometry boost/geometry/algorithms libs/geometry/test libs/geometry/test/algorithms libs/geometry/test/algorithms/overlay libs/geometry/test/algorithms/overlay/robustness libs/geometry/test/arithmetic libs/geometry/test/core libs/geometry/test/extensions libs/geometry/test/extensions/algorithms libs/geometry/test/extensions/gis libs/geometry/test/extensions/gis/io libs/geometry/test/extensions/gis/io/wkb libs/geometry/test/extensions/gis/io/wkt libs/geometry/test/extensions/gis/latlong libs/geometry/test/extensions/gis/projections libs/geometry/test/extensions/index libs/geometry/test/extensions/nsphere libs/geometry/test/geometries libs/geometry/test/geometries/concepts libs/geometry/test/iterators libs/geometry/test/multi libs/geometry/test/multi/algorithms libs/geometry/test/multi/algorithms/overlay libs/geometry/test/point_concept libs/geometry/test/policies libs/geometry/test/strategies libs/geometry/test/test_common libs/geometry/test/util
From: barend.gehrels_at_[hidden]
Date: 2010-02-20 10:04:03


Author: barendgehrels
Date: 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
New Revision: 59773
URL: http://svn.boost.org/trac/boost/changeset/59773

Log:
Added libs/geometry/test folder with many tests
Added:
   sandbox/geometry/libs/geometry/test/
   sandbox/geometry/libs/geometry/test/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/
   sandbox/geometry/libs/geometry/test/algorithms/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/algorithms_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/append.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/append.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/area.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/area.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/assign.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/assign.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/buffer.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/buffer.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/centroid.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/centroid.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/combine.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/combine.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/convert.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/convert.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/convex_hull.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/convex_hull.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/correct.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/correct.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/disjoint.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/disjoint.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/distance.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/distance.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/envelope.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/envelope.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/equals.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/equals.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/for_each.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/for_each.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/intersection.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/intersection_segment.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/intersects.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/intersects.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/is_convex.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/is_convex.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/length.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/length.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/make.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/make.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlaps.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlaps.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/
   sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.xls (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/merge_intersection_points.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/merge_intersection_points.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_common.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_pies.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_pies.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_stars.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_stars.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/robustness.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/test_overlay_p_q.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/perimeter.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/perimeter.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/sectionalize.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/sectionalize.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/simplify.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/simplify.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_area.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_centroid.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_combine.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_convex_hull.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_envelope.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_equals.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_for_each.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_intersects.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_length.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_overlaps.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_overlay.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_perimeter.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_relate.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_simplify.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/test_within.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/transform.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/transform.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/union.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/union.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/within.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/algorithms/within.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/
   sandbox/geometry/libs/geometry/test/arithmetic/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/arithmetic.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/arithmetic.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/arithmetic_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/cross_product.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/cross_product.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/dot_product.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/arithmetic/dot_product.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/boost.vsprops (contents, props changed)
   sandbox/geometry/libs/geometry/test/compile_test.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/compile_test.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/compile_test.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/
   sandbox/geometry/libs/geometry/test/core/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/access.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/access.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/coordinate_dimension.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/coordinate_system.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/coordinate_type.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/core.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/geometry_id.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/point_type.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/radian_access.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/radian_access.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/reverse_dispatch.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/reverse_dispatch.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/ring.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/tag.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/core/topological_dimension.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/custom_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/
   sandbox/geometry/libs/geometry/test/extensions/algorithms/
   sandbox/geometry/libs/geometry/test/extensions/gis/
   sandbox/geometry/libs/geometry/test/extensions/gis/io/
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/io_wkb_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/read_wkb.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/read_wkb.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/io_wkt_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/multi_wkt.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/multi_wkt.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/wkt.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/wkt.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/andoyer.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/andoyer.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/area_ll.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/area_ll.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/distance_mixed.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/distance_mixed.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/latlong.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse_dms.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse_dms.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/point_ll.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/latlong/point_ll.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection_epsg.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection_epsg.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/index/
   sandbox/geometry/libs/geometry/test/extensions/index/index.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/index/rtree.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/index/rtree.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/
   sandbox/geometry/libs/geometry/test/extensions/nsphere/access.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/area.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/area.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/circle.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/circle.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/multi_within.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/npshere_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/point_type.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/within.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/extensions/nsphere/within.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/
   sandbox/geometry/libs/geometry/test/geometries/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/adapted.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/box.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/box.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/concepts/
   sandbox/geometry/libs/geometry/test/geometries/concepts/check.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/concepts/check.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/concepts/check.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/custom_linestring.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/custom_linestring.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/geometries_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/segment.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/geometries/segment.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/ggl_headers.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/ggl_headers.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/ggl_test_common.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/
   sandbox/geometry/libs/geometry/test/iterators/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/circular_iterator.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/circular_iterator.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/ever_circling_iterator.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/ever_circling_iterator.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/iterators.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/segment_iterator.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/iterators/segment_iterator.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/
   sandbox/geometry/libs/geometry/test/multi/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/
   sandbox/geometry/libs/geometry/test/multi/algorithms/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_area.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_area.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_correct.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_correct.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_distance.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_distance.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_envelope.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_envelope.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_equals.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_equals.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_for_each.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_for_each.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_length.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_length.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_perimeter.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_perimeter.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_simplify.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_simplify.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/
   sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_common.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_svg_mapper.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/multi/multi_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/
   sandbox/geometry/libs/geometry/test/point_concept/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/array_point.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/concept_checker.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/function_asserting_a_point.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/function_requiring_a_point.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/point_with_incorrect_dimension.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/point_without_coordinate_type.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/point_without_dimension.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/point_without_getter.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/point_without_setter.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/well_formed_point.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/point_concept/well_formed_point_traits.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/policies/
   sandbox/geometry/libs/geometry/test/policies/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/policies/compare.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/policies/compare.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/policies/policy_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/
   sandbox/geometry/libs/geometry/test/strategies/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/cross_track.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/cross_track.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/haversine.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/haversine.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/projected_point.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/projected_point.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/pythagoras.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/pythagoras.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/segment_intersection.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/segment_intersection.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/segment_intersection_collinear.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/segment_intersection_collinear.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/side_by_cross_track.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/side_by_cross_track.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/strategies_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/transformer.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/strategies/transformer.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/test_common/
   sandbox/geometry/libs/geometry/test/test_common/test_point.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/test_common/with_pointer.hpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/
   sandbox/geometry/libs/geometry/test/util/Jamfile.v2 (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/as_range.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/as_range.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/copy.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/copy.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/for_each_coordinate.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/for_each_coordinate.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/select_most_precise.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/select_most_precise.vcproj (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/util_tests.sln (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/write_dsv.cpp (contents, props changed)
   sandbox/geometry/libs/geometry/test/util/write_dsv.vcproj (contents, props changed)
Text files modified:
   sandbox/geometry/boost/geometry/algorithms/equals.hpp | 61 ++++++++++++++++++++++++---------------
   sandbox/geometry/boost/geometry/geometry.hpp | 14 +++++++-
   2 files changed, 49 insertions(+), 26 deletions(-)

Modified: sandbox/geometry/boost/geometry/algorithms/equals.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/equals.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/equals.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -91,19 +91,29 @@
     }
 };
 
-struct equals_interrupt_policy
+class equals_interrupt_policy
 {
- static bool const enabled = true;
 
     // As soon as a turn is detected, this flag is set to true
     // and the process of getting turns (intersection points)
     // is interrupted
     bool turns_inside_or_outside;
+ bool has_collinear;
+
+
+public:
+ static bool const enabled = true;
 
     inline equals_interrupt_policy()
         : turns_inside_or_outside(false)
+ , has_collinear(false)
     {}
 
+ bool equals() const
+ {
+ return has_collinear && ! turns_inside_or_outside;
+ }
+
     template <typename Range>
     inline bool apply(Range const& range)
     {
@@ -112,30 +122,36 @@
             it != boost::end(range);
             ++it)
         {
- if (it->method == detail::overlay::method_collinear
- || it->method == detail::overlay::method_equal
- )
+ if (! it->ignore)
             {
- typedef typename boost::range_value<Range>::type turn_type;
- // If it is not such that both turns are collinear, the rings are not equal
- for (typename boost::range_iterator
- <
- typename turn_type::container_type const
- >::type oit = boost::begin(it->operations);
- oit != boost::end(it->operations);
- oit++)
+ if (it->method == detail::overlay::method_collinear
+ || it->method == detail::overlay::method_equal)
                 {
- if (oit->operation != detail::overlay::operation_continue)
+ typedef typename boost::range_value<Range>::type turn_type;
+ // If it is not such that both turns are collinear, the rings are not equal
+ for (typename boost::range_iterator
+ <
+ typename turn_type::container_type const
+ >::type oit = boost::begin(it->operations);
+ oit != boost::end(it->operations);
+ oit++)
                     {
- turns_inside_or_outside = true;
- return true;
+ if (oit->operation != detail::overlay::operation_continue)
+ {
+ turns_inside_or_outside = true;
+ return true;
+ }
+ else
+ {
+ has_collinear = true;
+ }
                     }
                 }
- }
- else
- {
- turns_inside_or_outside = true;
- return true;
+ else
+ {
+ turns_inside_or_outside = true;
+ return true;
+ }
             }
         }
         // It is not yet known, so don't interrupt
@@ -181,8 +197,7 @@
                 detail::overlay::assign_null_policy
>(ring1, ring2, turns, policy);
 
- return turns.size() > 0
- && ! policy.turns_inside_or_outside;
+ return policy.equals();
     }
 };
 

Modified: sandbox/geometry/boost/geometry/geometry.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometry.hpp (original)
+++ sandbox/geometry/boost/geometry/geometry.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -1,8 +1,8 @@
 // Boost.Geometry (aka GGL, Generic Geometry Library)
 //
-// Copyright Barend Gehrels 2007-2010, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008-2010
-// Copyright (c) 2009-2010 Mateusz Loskot <mateusz_at_[hidden]>
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
+// Copyright Bruno Lalande 2008, 2009
+// Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
@@ -17,7 +17,11 @@
 #include <boost/geometry/core/tag.hpp>
 #include <boost/geometry/core/tags.hpp>
 
+// Core algorithms
 #include <boost/geometry/core/access.hpp>
+#include <boost/geometry/core/exterior_ring.hpp>
+#include <boost/geometry/core/interior_rings.hpp>
+#include <boost/geometry/core/num_geometries.hpp>
 #include <boost/geometry/core/radian_access.hpp>
 #include <boost/geometry/core/topological_dimension.hpp>
 
@@ -31,6 +35,7 @@
 #include <boost/geometry/algorithms/append.hpp>
 #include <boost/geometry/algorithms/area.hpp>
 #include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/buffer.hpp>
 #include <boost/geometry/algorithms/centroid.hpp>
 #include <boost/geometry/algorithms/clear.hpp>
 #include <boost/geometry/algorithms/convert.hpp>
@@ -39,6 +44,7 @@
 #include <boost/geometry/algorithms/distance.hpp>
 #include <boost/geometry/algorithms/envelope.hpp>
 #include <boost/geometry/algorithms/for_each.hpp>
+#include <boost/geometry/algorithms/intermediate.hpp>
 #include <boost/geometry/algorithms/intersection.hpp>
 #include <boost/geometry/algorithms/intersects.hpp>
 #include <boost/geometry/algorithms/length.hpp>
@@ -46,9 +52,11 @@
 #include <boost/geometry/algorithms/num_points.hpp>
 #include <boost/geometry/algorithms/perimeter.hpp>
 #include <boost/geometry/algorithms/sectionalize.hpp>
+#include <boost/geometry/algorithms/selected.hpp>
 #include <boost/geometry/algorithms/simplify.hpp>
 #include <boost/geometry/algorithms/transform.hpp>
 #include <boost/geometry/algorithms/union.hpp>
+#include <boost/geometry/algorithms/unique.hpp>
 #include <boost/geometry/algorithms/within.hpp>
 
 // check includes all concepts

Added: sandbox/geometry/libs/geometry/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,27 @@
+# test/Jamfile.v2 controls building of Generic Geometry Library unit tests
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 testing ;
+
+project ggl-test
+ :
+ requirements
+ <include>.
+ <toolset>msvc:<asynch-exceptions>on
+ ;
+
+build-project core ;
+build-project point_concept ;
+# build-project geometries ;
+build-project arithmetic ;
+build-project algorithms ;
+build-project iterators ;
+build-project strategies ;
+build-project policies ;
+# build-project util ;
+build-project multi ;

Added: sandbox/geometry/libs/geometry/test/algorithms/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,35 @@
+# test/algorithms/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-algorithms
+ :
+ [ run append.cpp ]
+ [ run area.cpp ]
+ [ run assign.cpp ]
+ [ run centroid.cpp ]
+ [ run combine.cpp ]
+ [ run convert.cpp ]
+ [ run convex_hull.cpp ]
+ [ run correct.cpp ]
+ [ run disjoint.cpp ]
+ [ run equals.cpp ]
+ [ run distance.cpp ]
+ [ run envelope.cpp ]
+ [ run for_each.cpp ]
+ [ run intersection.cpp ]
+ [ run intersects.cpp ]
+ [ run length.cpp ]
+ [ run make.cpp ]
+ [ run overlaps.cpp ]
+ [ run perimeter.cpp ]
+ [ run sectionalize.cpp ]
+ [ run simplify.cpp ]
+ [ run transform.cpp ]
+ [ run union.cpp ]
+ [ run within.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/algorithms/algorithms_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/algorithms_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,163 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "append", "append.vcproj", "{774F6471-D8A0-481C-9B0A-4903EED25C70}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "area", "area.vcproj", "{E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assign", "assign.vcproj", "{94BC6547-67C1-44DB-903D-526537A91E23}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "combine", "combine.vcproj", "{5330DAB1-DF27-44FC-971B-3C5094F82FA3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convert", "convert.vcproj", "{FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convex_hull", "convex_hull.vcproj", "{0AFF7A85-63A7-4178-92A5-CC692B09F5B9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distance", "distance.vcproj", "{347D08A4-22E9-45B1-A55B-AE84AA2EAA53}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "envelope", "envelope.vcproj", "{26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make", "make.vcproj", "{BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simplify", "simplify.vcproj", "{B1760CB8-553B-42AB-B54E-3D0320FF252F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transform", "transform.vcproj", "{41413E56-08DA-4592-94D2-5311FE90C62B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "buffer", "buffer.vcproj", "{C66E1F6F-84F6-44E2-B5E8-2B127065BE31}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "for_each", "for_each.vcproj", "{774F6471-D8A0-481C-9B0A-4903EAD25B70}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "disjoint", "disjoint.vcproj", "{96D51D96-B35F-47C8-864D-371DF2280686}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "centroid", "centroid.vcproj", "{1E90E5BC-1280-4A6A-B197-132ABBF97EB9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersection", "intersection.vcproj", "{2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "correct", "correct.vcproj", "{71582BDA-D4DF-400D-8630-378BE102C038}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "within", "within.vcproj", "{C7BCD670-543D-4B29-B2D6-F3169949F79D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "length", "length.vcproj", "{C4D75B1E-34D5-4A98-8535-A9535BE949E4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perimeter", "perimeter.vcproj", "{EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "is_convex", "is_convex.vcproj", "{65EAD0CE-1AC7-4997-B618-55712AD7D8EA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "union", "union.vcproj", "{CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "overlaps", "overlaps.vcproj", "{30C37854-9ED6-4C1E-97FB-BF8637BD5811}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersects", "intersects.vcproj", "{B1A97F62-85CD-4239-BB56-619988B08260}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "equals", "equals.vcproj", "{E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Debug|Win32.ActiveCfg = Debug|Win32
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Debug|Win32.Build.0 = Debug|Win32
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Release|Win32.ActiveCfg = Release|Win32
+ {774F6471-D8A0-481C-9B0A-4903EED25C70}.Release|Win32.Build.0 = Release|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Debug|Win32.Build.0 = Debug|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Release|Win32.ActiveCfg = Release|Win32
+ {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Release|Win32.Build.0 = Release|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Debug|Win32.ActiveCfg = Debug|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Debug|Win32.Build.0 = Debug|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Release|Win32.ActiveCfg = Release|Win32
+ {94BC6547-67C1-44DB-903D-526537A91E23}.Release|Win32.Build.0 = Release|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Debug|Win32.Build.0 = Debug|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.ActiveCfg = Release|Win32
+ {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.Build.0 = Release|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.Build.0 = Debug|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.ActiveCfg = Release|Win32
+ {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.Build.0 = Release|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.Build.0 = Debug|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Release|Win32.ActiveCfg = Release|Win32
+ {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Release|Win32.Build.0 = Release|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Debug|Win32.ActiveCfg = Debug|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Debug|Win32.Build.0 = Debug|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Release|Win32.ActiveCfg = Release|Win32
+ {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Release|Win32.Build.0 = Release|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Debug|Win32.Build.0 = Debug|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Release|Win32.ActiveCfg = Release|Win32
+ {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Release|Win32.Build.0 = Release|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Debug|Win32.Build.0 = Debug|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Release|Win32.ActiveCfg = Release|Win32
+ {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Release|Win32.Build.0 = Release|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Debug|Win32.Build.0 = Debug|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Release|Win32.ActiveCfg = Release|Win32
+ {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Release|Win32.Build.0 = Release|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Debug|Win32.Build.0 = Debug|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Release|Win32.ActiveCfg = Release|Win32
+ {41413E56-08DA-4592-94D2-5311FE90C62B}.Release|Win32.Build.0 = Release|Win32
+ {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Debug|Win32.Build.0 = Debug|Win32
+ {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Release|Win32.ActiveCfg = Release|Win32
+ {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Release|Win32.Build.0 = Release|Win32
+ {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Debug|Win32.ActiveCfg = Debug|Win32
+ {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Debug|Win32.Build.0 = Debug|Win32
+ {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Release|Win32.ActiveCfg = Release|Win32
+ {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Release|Win32.Build.0 = Release|Win32
+ {96D51D96-B35F-47C8-864D-371DF2280686}.Debug|Win32.ActiveCfg = Debug|Win32
+ {96D51D96-B35F-47C8-864D-371DF2280686}.Debug|Win32.Build.0 = Debug|Win32
+ {96D51D96-B35F-47C8-864D-371DF2280686}.Release|Win32.ActiveCfg = Release|Win32
+ {96D51D96-B35F-47C8-864D-371DF2280686}.Release|Win32.Build.0 = Release|Win32
+ {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Debug|Win32.Build.0 = Debug|Win32
+ {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Release|Win32.ActiveCfg = Release|Win32
+ {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Release|Win32.Build.0 = Release|Win32
+ {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Debug|Win32.Build.0 = Debug|Win32
+ {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Release|Win32.ActiveCfg = Release|Win32
+ {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Release|Win32.Build.0 = Release|Win32
+ {71582BDA-D4DF-400D-8630-378BE102C038}.Debug|Win32.ActiveCfg = Debug|Win32
+ {71582BDA-D4DF-400D-8630-378BE102C038}.Debug|Win32.Build.0 = Debug|Win32
+ {71582BDA-D4DF-400D-8630-378BE102C038}.Release|Win32.ActiveCfg = Release|Win32
+ {71582BDA-D4DF-400D-8630-378BE102C038}.Release|Win32.Build.0 = Release|Win32
+ {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Debug|Win32.Build.0 = Debug|Win32
+ {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Release|Win32.ActiveCfg = Release|Win32
+ {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Release|Win32.Build.0 = Release|Win32
+ {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Debug|Win32.Build.0 = Debug|Win32
+ {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Release|Win32.ActiveCfg = Release|Win32
+ {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Release|Win32.Build.0 = Release|Win32
+ {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Debug|Win32.Build.0 = Debug|Win32
+ {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Release|Win32.ActiveCfg = Release|Win32
+ {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Release|Win32.Build.0 = Release|Win32
+ {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Debug|Win32.Build.0 = Debug|Win32
+ {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Release|Win32.ActiveCfg = Release|Win32
+ {65EAD0CE-1AC7-4997-B618-55712AD7D8EA}.Release|Win32.Build.0 = Release|Win32
+ {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Debug|Win32.Build.0 = Debug|Win32
+ {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Release|Win32.ActiveCfg = Release|Win32
+ {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Release|Win32.Build.0 = Release|Win32
+ {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Debug|Win32.ActiveCfg = Debug|Win32
+ {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Debug|Win32.Build.0 = Debug|Win32
+ {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Release|Win32.ActiveCfg = Release|Win32
+ {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Release|Win32.Build.0 = Release|Win32
+ {B1A97F62-85CD-4239-BB56-619988B08260}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B1A97F62-85CD-4239-BB56-619988B08260}.Debug|Win32.Build.0 = Debug|Win32
+ {B1A97F62-85CD-4239-BB56-619988B08260}.Release|Win32.ActiveCfg = Release|Win32
+ {B1A97F62-85CD-4239-BB56-619988B08260}.Release|Win32.Build.0 = Release|Win32
+ {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Debug|Win32.Build.0 = Debug|Win32
+ {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Release|Win32.ActiveCfg = Release|Win32
+ {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/algorithms/append.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/append.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,60 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <deque>
+#include <vector>
+
+#include <boost/concept/requires.hpp>
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/core/access.hpp>
+#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/algorithms/clear.hpp>
+#include <boost/geometry/algorithms/append.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+
+#include <test_common/test_point.hpp>
+
+template <typename G>
+void test_geometry()
+{
+ G geometry;
+ typedef typename boost::geometry::point_type<G>::type P;
+
+ boost::geometry::append(geometry, boost::geometry::make_zero<P>());
+ BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 1);
+
+ boost::geometry::clear(geometry);
+ BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 0);
+ //P p = boost::range::front(geometry);
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::linestring<P> >();
+ test_geometry<boost::geometry::linear_ring<P> >();
+ test_geometry<boost::geometry::polygon<P> >();
+
+ test_geometry<std::vector<P> >();
+ test_geometry<std::deque<P> >();
+ //test_geometry<std::list<P> >();
+}
+
+int test_main(int, char* [])
+{
+ test_all<test::test_point>();
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/append.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/append.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="append"
+ ProjectGUID="{774F6471-D8A0-481C-9B0A-4903EED25C70}"
+ RootNamespace="append"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\append"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\append"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\append.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/area.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/area.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,86 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithms/test_area.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+//#define GGL_TEST_DEBUG
+
+
+
+
+template <typename P>
+void test_all()
+{
+ //test_area_circle<P, double>();
+ test_geometry<boost::geometry::box<P> >("POLYGON((0 0,2 2))", 4.0);
+ test_geometry<boost::geometry::box<P> >("POLYGON((2 2,0 0))", 4.0);
+
+ // clockwise rings (second is wrongly ordered)
+ test_geometry<boost::geometry::linear_ring<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0);
+ test_geometry<boost::geometry::linear_ring<P> >("POLYGON((0 0,2 0,4 2,0 7,0 0))", -16.0);
+
+ // counter clockwise rings (first is wrongly ordered)
+ test_geometry<boost::geometry::linear_ring<P, std::vector, false> >
+ ("POLYGON((0 0,0 7,4 2,2 0,0 0))", -16.0);
+ test_geometry<boost::geometry::linear_ring<P, std::vector, false> >
+ ("POLYGON((0 0,2 0,4 2,0 7,0 0))", 16.0);
+
+ test_geometry<boost::geometry::polygon<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0);
+ test_geometry<boost::geometry::polygon<P> >("POLYGON((1 1,2 1,2 2,1 2,1 1))", -1.0);
+ test_geometry<boost::geometry::polygon<P> >
+ ("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<boost::geometry::polygon<P, std::vector, std::vector, false> >
+ ("POLYGON((0 0,0 7,4 2,2 0,0 0), (1 1,2 1,2 2,1 2,1 1))", -15.0);
+}
+
+template <typename Point>
+void test_spherical()
+{
+ boost::geometry::polygon<Point> geometry;
+
+ // unit-sphere has area of 4-PI. Polygon covering 1/8 of it:
+ double expected = 4.0 * boost::geometry::math::pi / 8.0;
+ boost::geometry::read_wkt("POLYGON((0 0,0 90,90 0,0 0))", geometry);
+
+ double area = boost::geometry::area(geometry);
+ BOOST_CHECK_CLOSE(area, expected, 0.0001);
+
+ // With strategy, radius 2 -> 4 pi r^2
+ boost::geometry::strategy::area::huiller
+ <
+ typename boost::geometry::point_type<Point>::type
+ > strategy(2.0);
+
+ area = boost::geometry::area(geometry, strategy);
+ BOOST_CHECK_CLOSE(area, 2.0 * 2.0 * expected, 0.0001);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ test_spherical<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/area.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/area.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="area"
+ ProjectGUID="{E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}"
+ RootNamespace="area"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\area.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/assign.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/assign.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,162 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+using namespace boost::geometry;
+
+template <typename L>
+void check_linestring_2d(const L& line)
+{
+ BOOST_CHECK((boost::size(line) == 3));
+ BOOST_CHECK((boost::geometry::num_points(line) == 3));
+
+ typedef typename point_type<L>::type P;
+ const P& p0 = line[0];
+ BOOST_CHECK(get<0>(p0) == 1);
+ BOOST_CHECK(get<1>(p0) == 2);
+
+ const P& p1 = line[1];
+ BOOST_CHECK(get<0>(p1) == 3);
+ BOOST_CHECK(get<1>(p1) == 4);
+
+ const P& p2 = line[2];
+ BOOST_CHECK(get<0>(p2) == 5);
+ BOOST_CHECK(get<1>(p2) == 6);
+}
+
+template <typename P>
+void test_assign_linestring_2d()
+{
+ boost::geometry::linestring<P> 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} };
+ boost::geometry::assign(line, coors);
+ check_linestring_2d(line);
+
+ // Test assignment of point array
+ P points[3];
+ boost::geometry::assign(points[0], 1, 2);
+ boost::geometry::assign(points[1], 3, 4);
+ boost::geometry::assign(points[2], 5, 6);
+ boost::geometry::assign(line, points);
+ check_linestring_2d(line);
+
+ // Test assignment of array with different point-type
+ boost::tuple<float, float> tuples[3];
+ tuples[0] = boost::make_tuple(1, 2);
+ tuples[1] = boost::make_tuple(3, 4);
+ tuples[2] = boost::make_tuple(5, 6);
+ boost::geometry::assign(line, tuples);
+ check_linestring_2d(line);
+}
+
+template <typename P>
+void test_assign_box_2d()
+{
+
+ typedef box<P> B;
+ B b;
+ boost::geometry::assign(b, 1, 2, 3, 4);
+ BOOST_CHECK((get<min_corner, 0>(b) == 1));
+ BOOST_CHECK((get<min_corner, 1>(b) == 2));
+ BOOST_CHECK((get<max_corner, 0>(b) == 3));
+ BOOST_CHECK((get<max_corner, 1>(b) == 4));
+
+ boost::geometry::assign_zero(b);
+ BOOST_CHECK((get<min_corner, 0>(b) == 0));
+ BOOST_CHECK((get<min_corner, 1>(b) == 0));
+ BOOST_CHECK((get<max_corner, 0>(b) == 0));
+ BOOST_CHECK((get<max_corner, 1>(b) == 0));
+
+ boost::geometry::assign_inverse(b);
+ BOOST_CHECK((get<min_corner, 0>(b) > 9999));
+ BOOST_CHECK((get<min_corner, 1>(b) > 9999));
+ BOOST_CHECK((get<max_corner, 0>(b) < 9999));
+ BOOST_CHECK((get<max_corner, 1>(b) < 9999));
+
+}
+
+template <typename P>
+void test_assign_point_3d()
+{
+ P p;
+ boost::geometry::assign(p, 1, 2, 3);
+ BOOST_CHECK(get<0>(p) == 1);
+ BOOST_CHECK(get<1>(p) == 2);
+ BOOST_CHECK(get<2>(p) == 3);
+
+ boost::geometry::detail::assign::assign_value(p, 123);
+ BOOST_CHECK(get<0>(p) == 123);
+ BOOST_CHECK(get<1>(p) == 123);
+ BOOST_CHECK(get<2>(p) == 123);
+
+ boost::geometry::assign_zero(p);
+ BOOST_CHECK(get<0>(p) == 0);
+ BOOST_CHECK(get<1>(p) == 0);
+ BOOST_CHECK(get<2>(p) == 0);
+
+}
+
+template <typename P>
+void test_assign_point_2d()
+{
+ P p;
+ boost::geometry::assign(p, 1, 2);
+ BOOST_CHECK(get<0>(p) == 1);
+ BOOST_CHECK(get<1>(p) == 2);
+
+ boost::geometry::detail::assign::assign_value(p, 123);
+ BOOST_CHECK(get<0>(p) == 123);
+ BOOST_CHECK(get<1>(p) == 123);
+
+ boost::geometry::assign_zero(p);
+ BOOST_CHECK(get<0>(p) == 0);
+ BOOST_CHECK(get<1>(p) == 0);
+}
+
+int test_main(int, char* [])
+{
+ test_assign_point_3d<int[3]>();
+ test_assign_point_3d<float[3]>();
+ test_assign_point_3d<double[3]>();
+ test_assign_point_3d<test::test_point>();
+ test_assign_point_3d<point<int, 3, boost::geometry::cs::cartesian> >();
+ test_assign_point_3d<point<float, 3, boost::geometry::cs::cartesian> >();
+ test_assign_point_3d<point<double, 3, boost::geometry::cs::cartesian> >();
+
+ test_assign_point_2d<int[2]>();
+ test_assign_point_2d<float[2]>();
+ test_assign_point_2d<double[2]>();
+ test_assign_point_2d<point<int, 2, boost::geometry::cs::cartesian> >();
+ test_assign_point_2d<point<float, 2, boost::geometry::cs::cartesian> >();
+ test_assign_point_2d<point<double, 2, boost::geometry::cs::cartesian> >();
+
+ test_assign_box_2d<int[2]>();
+ test_assign_box_2d<float[2]>();
+ test_assign_box_2d<double[2]>();
+ test_assign_box_2d<point<int, 2, boost::geometry::cs::cartesian> >();
+ test_assign_box_2d<point<float, 2, boost::geometry::cs::cartesian> >();
+ test_assign_box_2d<point<double, 2, boost::geometry::cs::cartesian> >();
+
+ test_assign_linestring_2d<point<int, 2, boost::geometry::cs::cartesian> >();
+ test_assign_linestring_2d<point<float, 2, boost::geometry::cs::cartesian> >();
+ test_assign_linestring_2d<point<double, 2, boost::geometry::cs::cartesian> >();
+
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/assign.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/assign.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="assign"
+ ProjectGUID="{94BC6547-67C1-44DB-903D-526537A91E23}"
+ RootNamespace="assign"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\assign"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\assign"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\assign.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/buffer.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/buffer.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,46 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/buffer.hpp>
+#include <boost/geometry/core/coordinate_type.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+
+ P p1(0, 0);
+ P p2(2, 2);
+ boost::geometry::box<P> b1(p1, p2);
+
+ boost::geometry::box<P> b2;
+ boost::geometry::buffer(b1, b2, coordinate_type(2));
+
+ // TODO: Check if buffer is correct
+ // using boost::geometry::equals to compare boxes
+ // (TODO: implement that)
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/buffer.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/buffer.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="buffer"
+ ProjectGUID="{C66E1F6F-84F6-44E2-B5E8-2B127065BE31}"
+ RootNamespace="buffer"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\buffer"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\buffer"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\buffer.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/centroid.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/centroid.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,76 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithms/test_centroid.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+template <typename P>
+void test_2d()
+{
+ test_centroid<boost::geometry::linestring<P> >("LINESTRING(1 1, 2 2, 3 3)", 2.0, 2.0);
+ test_centroid<boost::geometry::linestring<P> >("LINESTRING(0 0,0 4, 4 4)", 1.0, 3.0);
+ test_centroid<boost::geometry::linestring<P> >("LINESTRING(0 0,3 3,0 6,3 9,0 12)", 1.5, 6.0);
+
+ test_centroid<boost::geometry::linear_ring<P> >(
+ "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_centroid<boost::geometry::polygon<P> >(
+ "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<boost::geometry::polygon<P> >(
+ "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);
+
+
+ // ccw
+ test_centroid<boost::geometry::linear_ring<P, std::vector, false> >(
+ "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);
+
+
+ test_centroid<boost::geometry::box<P> >("POLYGON((1 2,3 4))", 2, 3);
+ test_centroid<P>("POINT(3 3)", 3, 3);
+}
+
+
+template <typename P>
+void test_3d()
+{
+ test_centroid<boost::geometry::box<P> >("POLYGON((1 2 3,5 6 7))", 3, 4, 5);
+ test_centroid<P>("POINT(1 2 3)", 1, 2, 3);
+}
+
+
+int test_main(int, char* [])
+{
+ test_2d<boost::geometry::point_xy<double> >();
+ test_2d<boost::tuple<float, float> >();
+ test_2d<boost::geometry::point_xy<float> >();
+
+ test_3d<boost::tuple<double, double, double> >();
+
+#if defined(HAVE_CLN)
+ //test_2d<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ //test_2d<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/centroid.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/centroid.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="centroid"
+ ProjectGUID="{1E90E5BC-1280-4A6A-B197-132ABBF97EB9}"
+ RootNamespace="centroid"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\centroid"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\centroid"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\centroid.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/combine.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/combine.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,151 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithms/test_combine.hpp>
+
+
+#include <boost/geometry/algorithms/make.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/std_pair_as_segment.hpp>
+#include <test_common/test_point.hpp>
+
+
+
+template <typename Point>
+void test_point_3d()
+{
+ boost::geometry::box<Point> b = boost::geometry::make_inverse<boost::geometry::box<Point> >();
+
+ test_combine<Point>(b, "POINT(1 2 5)", "(1,2,5),(1,2,5)");
+ test_combine<Point>(b, "POINT(3 4 6)", "(1,2,5),(3,4,6)");
+
+ test_combine<Point>(b, "POINT(4 4 5)", "(1,2,5),(4,4,6)");
+ test_combine<Point>(b, "POINT(4 5 5)", "(1,2,5),(4,5,6)");
+ test_combine<Point>(b, "POINT(10 10 4)", "(1,2,4),(10,10,6)");
+ test_combine<Point>(b, "POINT(9 9 4)", "(1,2,4),(10,10,6)");
+
+ test_combine<Point>(b, "POINT(0 2 7)", "(0,2,4),(10,10,7)");
+ test_combine<Point>(b, "POINT(0 0 7)", "(0,0,4),(10,10,7)");
+ test_combine<Point>(b, "POINT(-1 -1 5)", "(-1,-1,4),(10,10,7)");
+ test_combine<Point>(b, "POINT(0 0 5)", "(-1,-1,4),(10,10,7)");
+
+ test_combine<Point>(b, "POINT(15 -1 0)", "(-1,-1,0),(15,10,7)");
+ test_combine<Point>(b, "POINT(-1 15 10)", "(-1,-1,0),(15,15,10)");
+}
+
+template <typename Point>
+void test_box_3d()
+{
+ typedef boost::geometry::box<Point> box_type;
+ box_type b = boost::geometry::make_inverse<box_type>();
+
+ test_combine<box_type>(b, "BOX(0 2 5,4 4 6)", "(0,2,5),(4,4,6)");
+ test_combine<box_type>(b, "BOX(0 1 5,4 6 6)", "(0,1,5),(4,6,6)");
+ test_combine<box_type>(b, "BOX(-1 -1 6,10 10 5)", "(-1,-1,5),(10,10,6)");
+ test_combine<box_type>(b, "BOX(3 3 6,3 3 5)", "(-1,-1,5),(10,10,6)");
+
+ test_combine<box_type>(b, "BOX(3 15 7,-1 3 4)", "(-1,-1,4),(10,15,7)");
+ test_combine<box_type>(b, "BOX(-15 3 7,3 20 4)", "(-15,-1,4),(10,20,7)");
+ test_combine<box_type>(b, "BOX(3 -20 8,3 20 3)", "(-15,-20,3),(10,20,8)");
+ test_combine<box_type>(b, "BOX(-20 3 8,20 3 3)", "(-20,-20,3),(20,20,8)");
+}
+
+
+
+template <typename P>
+void test_3d()
+{
+ test_point_3d<P>();
+ test_box_3d<P>();
+}
+
+template <typename Point>
+void test_2d()
+{
+ typedef boost::geometry::box<Point> box_type;
+ typedef std::pair<Point, Point> segment_type;
+
+ box_type b = boost::geometry::make_inverse<box_type>();
+
+ test_combine<box_type>(b, "BOX(1 1,2 2)", "(1,1),(2,2)");
+
+ // Test an 'incorrect' box -> should also correctly update the bbox
+ test_combine<box_type>(b, "BOX(3 4,0 1)", "(0,1),(3,4)");
+
+ // Test a segment
+ test_combine<segment_type>(b, "SEGMENT(5 6,7 8)", "(0,1),(7,8)");
+}
+
+template <typename Point>
+void test_spherical_degree()
+{
+ boost::geometry::box<Point> b = boost::geometry::make_inverse<boost::geometry::box<Point> >();
+
+ test_combine<Point>(b, "POINT(179.73 71.56)",
+ "(179.73,71.56),(179.73,71.56)");
+ test_combine<Point>(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 "combines" it.
+ // It might be argued that "181.22" is displayed instead. However, they are
+ // the same.
+ test_combine<Point>(b, "POINT(-178.78 70.78)",
+ "(177.47,70.78),(-178.78,71.56)");
+}
+
+
+template <typename Point>
+void test_spherical_radian()
+{
+ boost::geometry::box<Point> b = boost::geometry::make_inverse<boost::geometry::box<Point> >();
+
+ test_combine<Point>(b, "POINT(3.128 1.249)",
+ "(3.128,1.249),(3.128,1.249)");
+ test_combine<Point>(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 "combines" it.
+ // It might be argued that "181.22" is displayed instead. However, they are
+ // the same.
+ test_combine<Point>(b, "POINT(-3.121 1.235)",
+ "(3.097,1.235),(-3.121,1.249)");
+}
+
+int test_main(int, char* [])
+{
+ test_2d<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+
+
+ test_3d<test::test_point>();
+ test_3d<boost::geometry::point<int, 3, boost::geometry::cs::cartesian> >();
+ test_3d<boost::geometry::point<float, 3, boost::geometry::cs::cartesian> >();
+ test_3d<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> >();
+
+ test_spherical_degree<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >();
+ test_spherical_radian<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::radian> > >();
+
+
+/***
+GMP/CLN still fails, due to boost::numeric_limits<T>, waiting for solution
+#if defined(HAVE_CLN)
+ test_3d<boost::geometry::point<boost::numeric_adaptor::cln_value_type,
+ 3, boost::geometry::cs::cartesian> >();
+#endif
+#if defined(HAVE_GMP)
+ test_3d<boost::geometry::point<boost::numeric_adaptor::gmp_value_type,
+ 3, boost::geometry::cs::cartesian> >();
+#endif
+***/
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/combine.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/combine.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="combine"
+ ProjectGUID="{5330DAB1-DF27-44FC-971B-3C5094F82FA3}"
+ RootNamespace="combine"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\combine"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\combine"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\combine.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/convert.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/convert.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,95 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/algorithms/convert.hpp>
+#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::box<P> box_type;
+
+ P p;
+ boost::geometry::assign(p, 1, 2);
+
+ box_type b;
+ boost::geometry::convert(p, b);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0, 0>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0, 1>(b)), 2.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1, 0>(b)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1, 1>(b)), 2.0, 0.001);
+}
+
+template <typename P>
+void test_std()
+{
+ test_all<P>();
+
+ typedef boost::geometry::box<P> box_type;
+ typedef boost::geometry::linear_ring<P> ring_type;
+ typedef boost::geometry::polygon<P> polygon_type;
+
+ box_type b;
+ boost::geometry::set<boost::geometry::min_corner, 0>(b, 1);
+ boost::geometry::set<boost::geometry::min_corner, 1>(b, 2);
+ boost::geometry::set<boost::geometry::max_corner, 0>(b, 3);
+ boost::geometry::set<boost::geometry::max_corner, 1>(b, 4);
+
+ ring_type ring;
+ boost::geometry::convert(b, ring);
+
+ //std::cout << boost::geometry::wkt(b) << std::endl;
+ //std::cout << boost::geometry::wkt(ring) << std::endl;
+
+ typename boost::range_const_iterator<ring_type>::type it = ring.begin();
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 2.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 4.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 3.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 4.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 3.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 2.0, 0.001);
+ it++;
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(*it)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(*it)), 2.0, 0.001);
+
+ BOOST_CHECK_EQUAL(ring.size(), 5);
+
+
+ polygon_type polygon;
+
+ boost::geometry::convert(ring, polygon);
+ BOOST_CHECK_EQUAL(boost::geometry::num_points(polygon), 5);
+
+ boost::geometry::convert(polygon, ring);
+ BOOST_CHECK_EQUAL(boost::geometry::num_points(ring), 5);
+}
+
+int test_main(int, char* [])
+{
+ test_std<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_std<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_std<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/convert.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/convert.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="convert"
+ ProjectGUID="{FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}"
+ RootNamespace="convert"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convert"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convert"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\convert.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/convex_hull.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/convex_hull.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,62 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <cstddef>
+#include <string>
+
+#include <algorithms/test_convex_hull.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+
+
+template <typename P>
+void test_all(bool do_rectangular = true)
+{
+ // from sample linestring
+
+ test_geometry<boost::geometry::linestring<P> >(
+ "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);
+
+ if (do_rectangular)
+ {
+ // rectangular, with concavity
+ test_geometry<boost::geometry::polygon<P> >(
+ "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<boost::geometry::polygon<P> >(
+ "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);
+}
+
+int test_main(int, char* [])
+{
+ //test_all<boost::geometry::point_xy<int> >();
+ //test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ // GMP compiles, but gives 'errors' in results (6 points in hull instead of 5)
+ // This is because of a vertex on the line, which is OK for the convex hull,
+ // but not OK for the strictly convex hull.
+ // Actually this is unexpected from a high-precision arithmetic library, the
+ // problem is the comparison (something is non-zero which should be calculated
+ // zero, in the direction).
+
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >(false);
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/convex_hull.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/convex_hull.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="convex_hull"
+ ProjectGUID="{0AFF7A85-63A7-4178-92A5-CC692B09F5B9}"
+ RootNamespace="convex_hull"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convex_hull"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\convex_hull"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\convex_hull.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/correct.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/correct.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,160 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <sstream>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/correct.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/util/write_dsv.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt, std::string const& expected)
+{
+ Geometry geometry;
+
+ boost::geometry::read_wkt(wkt, geometry);
+ boost::geometry::correct(geometry);
+
+ std::ostringstream out;
+ out << boost::geometry::wkt(geometry);
+
+ BOOST_CHECK_EQUAL(out.str(), expected);
+}
+
+
+// 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 <typename Geometry>
+void test_geometry_dsv(std::string const& wkt, std::string const& expected)
+{
+ Geometry geometry;
+
+ boost::geometry::read_wkt(wkt, geometry);
+ boost::geometry::correct(geometry);
+
+ std::ostringstream out;
+ out << boost::geometry::dsv(geometry);
+
+ BOOST_CHECK_EQUAL(out.str(), expected);
+}
+
+
+
+
+
+
+template <typename P>
+void test_all()
+{
+ // 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))";
+
+ // already cw_ring
+ test_geometry<boost::geometry::linear_ring<P> >(cw_ring, cw_ring);
+
+ // wrong order
+ test_geometry<boost::geometry::linear_ring<P> >(ccw_ring, cw_ring);
+
+ // not closed
+ test_geometry<boost::geometry::linear_ring<P> >(
+ "POLYGON((0 0,1 0,1 1,0 1))",
+ cw_ring);
+
+ // counter clockwise, cw_ring
+ test_geometry<boost::geometry::linear_ring<P, std::vector, false> >
+ (ccw_ring, ccw_ring);
+
+ test_geometry<boost::geometry::linear_ring<P, std::vector, false> >
+ (cw_ring, ccw_ring);
+
+
+ // polygon: cw_ring
+ test_geometry<boost::geometry::polygon<P> >(cw_ring, cw_ring);
+ // wrong order
+ test_geometry<boost::geometry::polygon<P> >(
+ "POLYGON((0 0,1 0,1 1,0 1,0 0))",
+ cw_ring);
+ // wrong order & not closed
+ test_geometry<boost::geometry::polygon<P> >(
+ "POLYGON((0 0,1 0,1 1,0 1))",
+ 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<boost::geometry::polygon<P> >(
+ cw_holey_polygon,
+ cw_holey_polygon);
+ // wrong order of main
+ test_geometry<boost::geometry::polygon<P> >(
+ "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<boost::geometry::polygon<P> >(
+ "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<boost::geometry::polygon<P> >(ccw_holey_polygon, cw_holey_polygon);
+
+ // test the counter-clockwise
+ test_geometry<boost::geometry::polygon<P, std::vector, std::vector, false> >(
+ ccw_holey_polygon, ccw_holey_polygon);
+
+ // Boxes
+ std::string proper_box = "POLYGON((0 0,0 2,2 2,2 0,0 0))";
+ test_geometry<boost::geometry::box<P> >(proper_box, proper_box);
+ test_geometry<boost::geometry::box<P> >("BOX(0 0,2 2)", proper_box);
+ test_geometry<boost::geometry::box<P> >("BOX(2 2,0 0)", proper_box);
+ test_geometry<boost::geometry::box<P> >("BOX(0 2,2 0)", proper_box);
+
+ // Cubes
+ typedef boost::geometry::box<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> > box3d;
+ std::string proper_3d_dsv_box = "((0, 0, 0), (2, 2, 2))";
+ test_geometry_dsv<box3d>("BOX(0 0 0,2 2 2)", proper_3d_dsv_box);
+ test_geometry_dsv<box3d>("BOX(2 2 2,0 0 0)", proper_3d_dsv_box);
+ test_geometry_dsv<box3d>("BOX(0 2 2,2 0 0)", proper_3d_dsv_box);
+ test_geometry_dsv<box3d>("BOX(2 0 2,0 2 0)", proper_3d_dsv_box);
+ test_geometry_dsv<box3d>("BOX(0 0 2,2 2 0)", proper_3d_dsv_box);
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ //test_all<float[2]>(); not yet because cannot be copied, for polygon
+ //test_all<double[2]>();
+
+ //test_all<point_xy<int> >();
+ //test_all<point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/correct.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/correct.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="correct"
+ ProjectGUID="{71582BDA-D4DF-400D-8630-378BE102C038}"
+ RootNamespace="correct"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\correct"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\correct"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\correct.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/disjoint.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/disjoint.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,109 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <string>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/disjoint.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <test_common/test_point.hpp>
+
+#include <algorithms/test_relate.hpp>
+
+
+
+template <typename G1, typename G2>
+void test_disjoint(std::string const& id,
+ std::string const& wkt1,
+ std::string const& wkt2, bool expected)
+{
+ G1 g1;
+ boost::geometry::read_wkt(wkt1, g1);
+
+ G2 g2;
+ boost::geometry::read_wkt(wkt2, g2);
+
+ bool detected = boost::geometry::disjoint(g1, g2);
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "disjoint: " << id
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+}
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::box<P> box;
+
+ test_disjoint<P, P>("pp1", "point(1 1)", "point(1 1)", false);
+ test_disjoint<P, P>("pp2", "point(1 1)", "point(1.001 1)", true);
+
+ // left-right
+ test_disjoint<box, box>("bb1", "box(1 1, 2 2)", "box(3 1, 4 2)", true);
+ test_disjoint<box, box>("bb2", "box(1 1, 2 2)", "box(2 1, 3 2)", false);
+ test_disjoint<box, box>("bb3", "box(1 1, 2 2)", "box(2 2, 3 3)", false);
+ test_disjoint<box, box>("bb4", "box(1 1, 2 2)", "box(2.001 2, 3 3)", true);
+
+ // up-down
+ test_disjoint<box, box>("bb5", "box(1 1, 2 2)", "box(1 3, 2 4)", true);
+ test_disjoint<box, box>("bb6", "box(1 1, 2 2)", "box(1 2, 2 3)", false);
+ // right-left
+ test_disjoint<box, box>("bb7", "box(1 1, 2 2)", "box(0 1, 1 2)", false);
+ test_disjoint<box, box>("bb8", "box(1 1, 2 2)", "box(0 1, 1 2)", false);
+
+ // point-box
+ test_disjoint<P, box>("pb1", "point(1 1)", "box(0 0, 2 2)", false);
+ test_disjoint<P, box>("pb2", "point(2 2)", "box(0 0, 2 2)", false);
+ test_disjoint<P, box>("pb3", "point(2.0001 2)", "box(1 1, 2 2)", true);
+ test_disjoint<P, box>("pb4", "point(0.9999 2)", "box(1 1, 2 2)", true);
+
+ // box-point (to test reverse compiling)
+ test_disjoint<box, P>("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 boost::geometry::polygon<P> polygon;
+ typedef boost::geometry::linear_ring<P> ring;
+
+ // Four times same test with other types
+ test_disjoint<polygon, polygon>("disjoint_simplex_pp", disjoint_simplex[0], disjoint_simplex[1], true);
+ test_disjoint<ring, polygon>("disjoint_simplex_rp", disjoint_simplex[0], disjoint_simplex[1], true);
+ test_disjoint<ring, ring>("disjoint_simplex_rr", disjoint_simplex[0], disjoint_simplex[1], true);
+ test_disjoint<polygon, ring>("disjoint_simplex_pr", disjoint_simplex[0], disjoint_simplex[1], true);
+
+ // Testing touch
+ test_disjoint<polygon, polygon>("touch_simplex_pp", touch_simplex[0], touch_simplex[1], false);
+
+ // Testing overlap (and test compiling with box)
+ test_disjoint<polygon, polygon>("overlaps_box_pp", overlaps_box[0], overlaps_box[1], false);
+ test_disjoint<box, polygon>("overlaps_box_bp", overlaps_box[0], overlaps_box[1], false);
+ test_disjoint<box, ring>("overlaps_box_br", overlaps_box[0], overlaps_box[1], false);
+ test_disjoint<polygon, box>("overlaps_box_pb", overlaps_box[1], overlaps_box[0], false);
+ test_disjoint<ring, box>("overlaps_box_rb", overlaps_box[1], overlaps_box[0], false);
+
+ // Test if within(a,b) returns false for disjoint
+ test_disjoint<ring, ring>("within_simplex_rr1", within_simplex[0], within_simplex[1], false);
+ test_disjoint<ring, ring>("within_simplex_rr2", within_simplex[1], within_simplex[0], false);
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/disjoint.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/disjoint.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="disjoint"
+ ProjectGUID="{96D51D96-B35F-47C8-864D-371DF2280686}"
+ RootNamespace="disjoint"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;..;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\disjoint.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/distance.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/distance.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,204 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 TEST_ARRAY
+
+#include <sstream>
+
+#include <boost/mpl/if.hpp>
+#include <ggl_test_common.hpp>
+
+
+#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#ifndef TEST_ARRAY
+#include <boost/geometry/algorithms/make.hpp>
+#endif
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename P>
+void test_distance_result()
+{
+ typedef typename boost::geometry::distance_result<P, P>::type distance_type;
+
+#ifndef TEST_ARRAY
+ P p1 = boost::geometry::make<P>(0, 0);
+ P p2 = boost::geometry::make<P>(3, 0);
+ P p3 = boost::geometry::make<P>(0, 4);
+#else
+ P p1, p2, p3;
+ boost::geometry::set<0>(p1, 0); boost::geometry::set<1>(p1, 0);
+ boost::geometry::set<0>(p2, 3); boost::geometry::set<1>(p2, 0);
+ boost::geometry::set<0>(p3, 0); boost::geometry::set<1>(p3, 4);
+#endif
+
+ distance_type dr12 = boost::geometry::distance(p1, p2);
+ distance_type dr13 = boost::geometry::distance(p1, p3);
+ distance_type dr23 = boost::geometry::distance(p2, p3);
+
+ BOOST_CHECK_CLOSE(double(dr12), 3.000, 0.001);
+ BOOST_CHECK_CLOSE(double(dr13), 4.000, 0.001);
+ BOOST_CHECK_CLOSE(double(dr23), 5.000, 0.001);
+
+ // COMPILATION TESTS
+ distance_type comparable = boost::geometry::make_distance_result<distance_type>(3);
+ //BOOST_CHECK_CLOSE(comparable.value(), 9.000, 0.001);
+
+
+ // Question: how to check if the implemented operator is used, and not the auto-conversion to double?
+ if (comparable == dr12) {};
+ if (comparable < dr12) {};
+ if (comparable > dr12) {};
+
+ // Check streamability
+ std::ostringstream s;
+ s << comparable;
+
+ // Check comparisons with plain double
+ double d = 3.0;
+ if (dr12 == d) {};
+ if (dr12 < d) {};
+ if (dr12 > d) {};
+
+}
+
+template <typename P>
+void test_distance_point()
+{
+ P p1;
+ boost::geometry::set<0>(p1, 1);
+ boost::geometry::set<1>(p1, 1);
+
+ P p2;
+ boost::geometry::set<0>(p2, 2);
+ boost::geometry::set<1>(p2, 2);
+
+ double d = boost::geometry::distance(p1, p2);
+ BOOST_CHECK_CLOSE(d, 1.4142135, 0.001);
+}
+
+template <typename P>
+void test_distance_segment()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+
+ P s1; boost::geometry::set<0>(s1, 2); boost::geometry::set<1>(s1, 2);
+ P s2; boost::geometry::set<0>(s2, 3); boost::geometry::set<1>(s2, 3);
+
+ // Check points left, right, projected-left, projected-right, on segment
+ P p1; boost::geometry::set<0>(p1, 0); boost::geometry::set<1>(p1, 0);
+ P p2; boost::geometry::set<0>(p2, 4); boost::geometry::set<1>(p2, 4);
+ P p3; boost::geometry::set<0>(p3, coordinate_type(2.4)); boost::geometry::set<1>(p3, coordinate_type(2.6));
+ P p4; boost::geometry::set<0>(p4, coordinate_type(2.6)); boost::geometry::set<1>(p4, coordinate_type(2.4));
+ P p5; boost::geometry::set<0>(p5, 2.5); boost::geometry::set<1>(p5, 2.5);
+
+ const boost::geometry::segment<const P> seg(s1, s2);
+
+ double d1 = boost::geometry::distance(p1, seg); BOOST_CHECK_CLOSE(d1, 2.8284271, 0.001);
+ double d2 = boost::geometry::distance(p2, seg); BOOST_CHECK_CLOSE(d2, 1.4142135, 0.001);
+ double d3 = boost::geometry::distance(p3, seg); BOOST_CHECK_CLOSE(d3, 0.141421, 0.001);
+ double d4 = boost::geometry::distance(p4, seg); BOOST_CHECK_CLOSE(d4, 0.141421, 0.001);
+ double d5 = boost::geometry::distance(p5, seg); BOOST_CHECK_CLOSE(d5, 0.0, 0.001);
+
+ // Reverse case
+ double dr1 = boost::geometry::distance(seg, p1); BOOST_CHECK_CLOSE(dr1, d1, 0.001);
+ double dr2 = boost::geometry::distance(seg, p2); BOOST_CHECK_CLOSE(dr2, d2, 0.001);
+}
+
+template <typename P>
+void test_distance_linestring()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+
+ boost::array<P, 2> points;
+ boost::geometry::set<0>(points[0], 1);
+ boost::geometry::set<1>(points[0], 1);
+ boost::geometry::set<0>(points[1], 3);
+ boost::geometry::set<1>(points[1], 3);
+
+#ifndef TEST_ARRAY
+ P p = boost::geometry::make<P>(2, 1);
+#else
+ P p;
+ boost::geometry::set<0>(p, 2); boost::geometry::set<1>(p, 1);
+#endif
+
+ double d = boost::geometry::distance(p, points);
+ BOOST_CHECK_CLOSE(d, 0.70710678, 0.001);
+
+#ifndef TEST_ARRAY
+ p = boost::geometry::make<P>(5, 5);
+#else
+ boost::geometry::set<0>(p, 5); boost::geometry::set<1>(p, 5);
+#endif
+ d = boost::geometry::distance(p, points);
+ BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+
+
+ boost::geometry::linestring<P> line;
+#ifndef TEST_ARRAY
+ line.push_back(boost::geometry::make<P>(1,1));
+ line.push_back(boost::geometry::make<P>(2,2));
+ line.push_back(boost::geometry::make<P>(3,3));
+#else
+ {
+ P lp;
+ boost::geometry::set<0>(lp, 1); boost::geometry::set<1>(lp, 1); line.push_back(lp);
+ boost::geometry::set<0>(lp, 2); boost::geometry::set<1>(lp, 2); line.push_back(lp);
+ boost::geometry::set<0>(lp, 3); boost::geometry::set<1>(lp, 3); line.push_back(lp);
+ }
+#endif
+
+#ifndef TEST_ARRAY
+ p = boost::geometry::make<P>(5, 5);
+#else
+ boost::geometry::set<0>(p, 5); boost::geometry::set<1>(p, 5);
+#endif
+
+ d = boost::geometry::distance(p, line);
+ BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+
+ // Reverse case
+ d = boost::geometry::distance(line, p);
+ BOOST_CHECK_CLOSE(d, 2.828427, 0.001);
+}
+
+template <typename P>
+void test_all()
+{
+ test_distance_result<P>();
+ test_distance_point<P>();
+ test_distance_segment<P>();
+#ifndef TEST_ARRAY
+ test_distance_linestring<P>();
+#endif
+}
+
+int test_main(int, char* [])
+{
+#ifdef TEST_ARRAY
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test::test_point>(); // located here because of 3D
+#endif
+
+ //test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::tuple<float, float> >();
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/distance.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/distance.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="distance"
+ ProjectGUID="{347D08A4-22E9-45B1-A55B-AE84AA2EAA53}"
+ RootNamespace="distance"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\distance"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\distance"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\distance.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/envelope.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/envelope.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,57 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithms/test_envelope.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/std_pair_as_segment.hpp>
+#include <test_common/test_point.hpp>
+
+
+
+template <typename P>
+void test_2d()
+{
+ test_envelope<P>("POINT(1 1)", 1, 1, 1, 1);
+ test_envelope<boost::geometry::linestring<P> >("LINESTRING(1 1,2 2)", 1, 2, 1, 2);
+ test_envelope<boost::geometry::polygon<P> >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3);
+
+ test_envelope<boost::geometry::linear_ring<P> >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3);
+ test_envelope<boost::geometry::box<P> >("BOX(1 1,3 3)", 1, 3, 1, 3);
+
+ typedef std::pair<P, P> segment_type;
+ test_envelope<segment_type>("SEGMENT(1 1,3 3)", 1, 3, 1, 3);
+}
+
+template <typename P>
+void test_3d()
+{
+ test_envelope<P>("POINT(1 2 3)", 1, 1, 2, 2, 3, 3);
+ test_envelope<P>("POINT(3 2 1)", 3, 3, 2, 2, 1, 1);
+ test_envelope<boost::geometry::linestring<P> >("LINESTRING(1 1 1,2 2 2)", 1, 2, 1, 2, 1, 2);
+ test_envelope<boost::geometry::box<P> >("BOX(1 1 1,3 3 3)", 1, 3, 1, 3, 1, 3);
+}
+
+
+int test_main(int, char* [])
+{
+ //test_2d<int[2]>();
+ //test_2d<float[2]>();
+ //test_2d<double[2]>();
+ test_2d<boost::tuple<float, float> >();
+ test_2d<boost::geometry::point_xy<int> >();
+ test_2d<boost::geometry::point_xy<float> >();
+ test_2d<boost::geometry::point_xy<double> >();
+
+ test_3d<test::test_point>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/envelope.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/envelope.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="envelope"
+ ProjectGUID="{26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}"
+ RootNamespace="envelope"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\envelope"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\envelope"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\envelope.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/equals.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/equals.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,95 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <algorithms/test_equals.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::box<P> box;
+ typedef boost::geometry::linear_ring<P> ring;
+ typedef boost::geometry::polygon<P> polygon;
+
+
+ test_geometry<P, P>("p1", "POINT(1 1)", "POINT(1 1)", true);
+ test_geometry<P, P>("p2", "POINT(1 1)", "POINT(1 2)", false);
+ test_geometry<box, box>("b1", "BOX(1 1,2 2)", "BOX(1 2,2 2)", false);
+ test_geometry<box, box>("b1", "BOX(1 2,3 4)", "BOX(1 2,3 4)", true);
+
+
+ std::string case_p1 = "POLYGON((0 0,0 2,2 2,0 0))";
+
+ // Completely equal
+ test_geometry<ring, ring>("poly_eq", case_p1, case_p1, true);
+ // Shifted
+ test_geometry<ring, ring>("poly_sh", "POLYGON((2 2,0 0,0 2,2 2))", case_p1, true);
+ // Extra coordinate
+ test_geometry<ring, ring>("poly_extra", case_p1, "POLYGON((0 0,0 2,2 2,1 1,0 0))", true);
+ // Degenerate points
+ test_geometry<ring, ring>("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<ring, ring>("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<ring, ring>("poly_uneq", case_p1, "POLYGON((1 1,1 3,3 3,1 1))", false);
+
+ // Polygons, exterior rings equal (shifted)
+ test_geometry<polygon, polygon>("poly_sh2", case_p1, "POLYGON((0 2,2 2,0 0,0 2))", true);
+
+ // One having hole
+ test_geometry<polygon, polygon>("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<polygon, polygon>("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<polygon, polygon>("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<polygon, polygon>("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<polygon, polygon>("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<polygon, ring>("poly_sh2_pr", case_p1, case_p1, true);
+ test_geometry<ring, polygon>("poly_sh2_rp", case_p1, case_p1, true);
+
+ // Todo: ring/box, poly/box
+}
+
+
+
+
+int test_main( int , char* [] )
+{
+ //test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+// test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+// test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/equals.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/equals.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="equals"
+ ProjectGUID="{E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}"
+ RootNamespace="equals"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\equals"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\equals"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\equals.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/for_each.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/for_each.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,74 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <algorithms/test_for_each.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+
+
+template <typename P>
+void test_all()
+{
+ test_geometry<P>
+ (
+ "POINT(1 1)"
+
+ // per point
+ , 1
+ , "POINT(101 1)"
+ , "POINT(101 100)"
+ // per segment
+ , ""
+ , 0
+ , "POINT(1 1)"
+ );
+ test_geometry<boost::geometry::linestring<P> >
+ (
+ "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<boost::geometry::linear_ring<P> >
+ (
+ "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<boost::geometry::polygon<P> >
+ (
+ "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),(2 2,3 2,3 3,2 3,2 2))"
+ );
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/for_each.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/for_each.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="for_each"
+ ProjectGUID="{774F6471-D8A0-481C-9B0A-4903EAD25B70}"
+ RootNamespace="for_each"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\for_each"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\for_each"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\for_each.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,276 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <string>
+
+
+#include <algorithms/test_intersection.hpp>
+#include <algorithms/test_overlay.hpp>
+
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <test_common/test_point.hpp>
+#include <test_common/with_pointer.hpp>
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::linestring<P> linestring;
+ typedef boost::geometry::polygon<P> polygon;
+ typedef boost::geometry::box<P> box;
+
+ std::string clip = "box(2 2,8 8)";
+
+ // Basic check: box/linestring, is clipping OK? should compile in any order
+ test_one<linestring, linestring, box>("llb", "LINESTRING(0 0,10 10)", clip, 1, 2, sqrt(2.0 * 6.0 * 6.0));
+ test_one<linestring, box, linestring>("lbl", clip, "LINESTRING(0 0,10 10)", 1, 2, sqrt(2.0 * 6.0 * 6.0));
+
+ // Completely inside
+ test_one<linestring, linestring, box>("llbi", "LINESTRING(3 3,7 7)", clip, 1, 2, sqrt(2.0 * 4.0 * 4.0));
+
+ // Completely outside
+ test_one<linestring, linestring, box>("llbo", "LINESTRING(9 9,10 10)", clip, 0, 0, 0);
+
+ // Touching with point (-> output linestring with ONE point)
+ //std::cout << "Note: the output line is degenerate! Might be removed!" << std::endl;
+ test_one<linestring, linestring, box>("llb_touch", "LINESTRING(8 8,10 10)", clip, 1, 1, 0.0);
+
+ // Along border
+ test_one<linestring, linestring, box>("llb_along", "LINESTRING(2 2,2 8)", clip, 1, 2, 6);
+
+ // 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<linestring, linestring, box>("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.5);
+
+
+ test_one<polygon, box, polygon>("boxring", example_box, example_ring,
+ 2, 12, 1.09125);
+
+ test_one<polygon, box, polygon>("boxpoly", example_box, example_polygon,
+ 3, 19, 0.840166);
+
+ test_one<polygon, polygon, polygon>("star_ring", example_star, example_ring,
+ 1, 18, 2.80983);
+
+ test_one<polygon, polygon, polygon>("star_poly", example_star, example_polygon,
+ 1, 0, // CLN: 23 points, other types: 22 point (one is merged)
+ 2.5020508);
+
+
+ test_one<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("clip_poly7", "box(0 0, 3 3)",
+ "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))", 1, 4, 0.75);
+
+ test_one<polygon, polygon, polygon>("first_within_second1",
+ first_within_second[0], first_within_second[1],
+ 1, 5, 1.0);
+
+ test_one<polygon, polygon, polygon>("first_within_second2",
+ first_within_second[1], first_within_second[0],
+ 1, 5, 1.0);
+
+ test_one<polygon, polygon, polygon>("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<polygon, polygon, polygon>("new_hole",
+ new_hole[0], new_hole[1],
+ 2, 10, 2.0);
+
+ // Two identical
+ test_one<polygon, polygon, polygon>("identical",
+ identical[0], identical[1],
+ 1, 5, 1.0);
+
+ // Two, inside each other, having intersections but holes are disjoint
+ test_one<polygon, polygon, polygon>("intersect_holes_disjoint",
+ intersect_holes_disjoint[0], intersect_holes_disjoint[1],
+ 1, 15, 18.0);
+
+ // Two, inside each other, having intersections; holes separate intersections
+ test_one<polygon, polygon, polygon>("intersect_holes_intersect",
+ intersect_holes_intersect[0], intersect_holes_intersect[1],
+ 1, 14, 18.25);
+
+ test_one<polygon, polygon, polygon>("intersect_holes_intersect_and_disjoint",
+ intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1],
+ 1, 19, 17.25);
+
+ test_one<polygon, polygon, polygon>("intersect_holes_intersect_and_touch",
+ intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1],
+ 1, 23, 17.25);
+
+ test_one<polygon, polygon, polygon>("intersect_holes_new_ring",
+ intersect_holes_new_ring[0], intersect_holes_new_ring[1],
+ 2, 23, 122.1039);
+
+ test_one<polygon, polygon, polygon>("winded",
+ winded[0], winded[1],
+ 1, 22, 40.0);
+
+ test_one<polygon, polygon, polygon>("two_bends",
+ two_bends[0], two_bends[1],
+ 1, 7, 24.0);
+
+ test_one<polygon, polygon, polygon>("star_comb_15",
+ star_15, comb_15,
+ 28, 150, 189.952883);
+
+ test_one<polygon, polygon, polygon>("simplex_normal",
+ simplex_normal[0], simplex_normal[1],
+ 1, 7, 5.47363293);
+
+ test_one<polygon, polygon, polygon>("fitting",
+ fitting[0], fitting[1],
+ 0, 0, 0);
+
+ test_one<polygon, polygon, polygon>("dist_zero",
+ distance_zero[0], distance_zero[1],
+ 1, 0 /* f: 4, other: 5 */, 0.29516139, 0.01);
+
+ test_one<polygon, polygon, polygon>("ehd",
+ equal_holes_disjoint[0], equal_holes_disjoint[1],
+ 1, 20, 81 - 2 * 3 * 3 - 3 * 7);
+
+ test_one<polygon, polygon, polygon>("only_hole_intersections1",
+ only_hole_intersections[0], only_hole_intersections[1],
+ 1, 21, 178.090909);
+ test_one<polygon, polygon, polygon>("only_hole_intersection2",
+ only_hole_intersections[0], only_hole_intersections[2],
+ 1, 21, 149.090909);
+
+ test_one<polygon, polygon, polygon>("intersect_exterior_and_interiors_winded",
+ intersect_exterior_and_interiors_winded[0], intersect_exterior_and_interiors_winded[1],
+ 1, 14, 25.2166667);
+
+
+
+ return;
+
+
+ /*
+ REVERSED cases (should be handled/tested differently)
+ test_one<polygon, polygon, polygon>(102,
+ simplex_normal[0], simplex_reversed[1],
+ 1, 7, 24.0);
+
+ test_one<polygon, polygon, polygon>(103,
+ simplex_reversed[0], simplex_normal[1],
+ 1, 7, 24.0);
+
+ test_one<polygon, polygon, polygon>(104,
+ simplex_reversed[0], simplex_reversed[1],
+ 1, 7, 24.0);
+ */
+
+
+ // Icovist (submitted by Brandon during Formal Review)
+ // Test the FORWARD case
+ {
+ std::string tn = string_from_type<typename boost::geometry::coordinate_type<P>::type>::name();
+ test_one<polygon, polygon, polygon>("isovist",
+ isovist[0], isovist[1],
+ 1,
+ tn == std::string("f") ? 19 : tn == std::string("d") ? 21 : 20,
+ 88.19203,
+ tn == std::string("f") ? 0.5 : tn == std::string("d") ? 0.1 : 0.01);
+ }
+
+
+ // Test the REVERSE case - does not give correct results yet
+ /*
+ test_one<polygon, polygon, polygon>("icovist_r",
+ isovist[0], isovist[2],
+ 1, 4, 0.29516139, 0.01);
+ */
+
+
+ /*
+ test_one<polygon, box, polygon>(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<test::test_point_xy*> 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);
+
+ boost::geometry::box<boost::geometry::point_xy<double> > box;
+ boost::geometry::assign(box, 2, 2, 8, 8);
+
+ typedef boost::geometry::linestring<boost::geometry::point_xy<double> > output_type;
+ std::vector<output_type> clip;
+ boost::geometry::intersection_inserter<output_type>(box, ln, std::back_inserter(clip));
+
+ double length = 0;
+ int n = 0;
+ for (std::vector<output_type>::const_iterator it = clip.begin();
+ it != clip.end(); ++it)
+ {
+ length += boost::geometry::length(*it);
+ n += boost::geometry::num_points(*it);
+ }
+
+ BOOST_CHECK_EQUAL(clip.size(), 1);
+ BOOST_CHECK_EQUAL(n, 2);
+ BOOST_CHECK_CLOSE(length, sqrt(2.0 * 6.0 * 6.0), 0.001);
+
+
+ for (unsigned int i = 0; i < ln.size(); i++)
+ {
+ delete ln[i];
+ }
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+
+#if defined(HAVE_GMP)
+ //test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+ //test_pointer_version();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/intersection.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/intersection.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="intersection"
+ ProjectGUID="{2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}"
+ RootNamespace="intersection"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersection"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersection"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\intersection.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/intersection_segment.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/intersection_segment.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,129 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithm>
+#include <ostream>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <boost/config.hpp>
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/correct.hpp>
+#include <boost/geometry/algorithms/within.hpp>
+#include <boost/geometry/algorithms/intersection_segment.hpp>
+#include <boost/geometry/io/wkt/aswkt.hpp>
+
+static std::ostream & operator<<(std::ostream &s, const boost::geometry::intersection_result& r)
+{
+ switch(r)
+ {
+ case boost::geometry::is_intersect_no : s << "is_intersect_no"; break;
+ case boost::geometry::is_intersect : s << "is_intersect"; break;
+ case boost::geometry::is_parallel : s << "is_parallel"; break;
+ case boost::geometry::is_collinear_no : s << "is_collinear_no"; break;
+ case boost::geometry::is_collinear_one : s << "is_collinear_one"; break;
+ case boost::geometry::is_collinear_connect : s << "is_collinear_connect"; break;
+ case boost::geometry::is_collinear_overlap : s << "is_collinear_overlap"; break;
+ case boost::geometry::is_collinear_overlap_opposite : s << "is_collinear_overlap_opposite"; break;
+ case boost::geometry::is_collinear_connect_opposite : s << "is_collinear_connect_opposite"; break;
+
+ // detailed connection results:
+ case boost::geometry::is_intersect_connect_s1p1 : s << "is_intersect_connect_s1p1"; break;
+ case boost::geometry::is_intersect_connect_s1p2 : s << "is_intersect_connect_s1p2"; break;
+ case boost::geometry::is_intersect_connect_s2p1 : s << "is_intersect_connect_s2p1"; break;
+ case boost::geometry::is_intersect_connect_s2p2 : s << "is_intersect_connect_s2p2"; break;
+ }
+ return s;
+}
+
+static std::string as_string(const boost::geometry::intersection_result& r)
+{
+ std::stringstream out;
+ out << r;
+ return out.str();
+}
+
+typedef boost::geometry::point<double> P;
+typedef boost::geometry::const_segment<P> S;
+
+
+static void test_intersection(double s1x1, double s1y1, double s1x2, double s1y2,
+ double s2x1, double s2y1, double s2x2, double s2y2,
+ // Expected results
+ boost::geometry::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<P> ip;
+ double ra, rb;
+ boost::geometry::intersection_result r = boost::geometry::intersection_s(s1, s2, ra, rb, ip);
+ r = boost::geometry::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, boost::geometry::is_collinear_overlap, 2, P(0,0), P(1,1));
+ test_intersection(1,1, 0,0, 0,0, 1,1, boost::geometry::is_collinear_overlap_opposite, 2, P(1,1), P(0,0));
+ test_intersection(0,1, 0,2, 0,1, 0,2, boost::geometry::is_collinear_overlap, 2, P(0,1), P(0,2)); // Vertical
+ test_intersection(0,2, 0,1, 0,1, 0,2, boost::geometry::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, boost::geometry::is_collinear_overlap, 2, P(0,0), P(1,1));
+ test_intersection(0,0, 1,1, 0.5,0.5, 1.5,1.5, boost::geometry::is_collinear_overlap, 2, P(0.5,0.5), P(1,1));
+ test_intersection(0,0, 0,1, 0,-10, 0,10, boost::geometry::is_collinear_overlap, 2, P(0,0), P(0,1)); // Vertical
+ test_intersection(0,0, 0,1, 0,10, 0,-10, boost::geometry::is_collinear_overlap_opposite, 2, P(0,0), P(0,1)); // Vertical
+ test_intersection(0,0, 1,1, 1,1, 2,2, boost::geometry::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, boost::geometry::is_collinear_no, 0, P(0,0), P(0,0));
+ test_intersection(0,0, 0,1, 0,5, 0,6, boost::geometry::is_collinear_no, 0, P(0,0), P(0,0)); // Vertical
+ // Parallel cases
+ test_intersection(0,0, 1,1, 1,0, 2,1, boost::geometry::is_parallel, 0, P(0,0), P(0,1));
+ // Intersect cases
+ test_intersection(0,2, 4,2, 3,0, 3,4, boost::geometry::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, boost::geometry::is_collinear_no, 0, P(1,1), P(0,0)); // Colinear/no
+ test_intersection(2,2, 2,2, 1,1, 3,3, boost::geometry::is_collinear_one, 1, P(2,2.01), P(0,0)); // On segment
+ test_intersection(1,1, 3,3, 2,2, 2,2, boost::geometry::is_collinear_one, 1, P(2,2), P(0,0)); // On segment
+ test_intersection(1,1, 3,3, 1,1, 1,1, boost::geometry::is_collinear_one, 1, P(1,1), P(0,0)); // On segment, start
+ test_intersection(1,1, 3,3, 3,3, 3,3, boost::geometry::is_collinear_one, 1, P(3,3), P(0,0)); // On segment, end
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/intersects.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/intersects.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,83 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <algorithms/test_intersects.hpp>
+
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/linestring.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ // intersect <=> ! disjoint
+ // so most tests are done in disjoint test.
+ // We only test compilation of one case.
+ test_geometry<P, boost::geometry::box<P> >("POINT(1 1)", "BOX(0 0,2 2)", true);
+
+ // self-intersecting is not tested in disjoint, so that is done here.
+ typedef boost::geometry::polygon<P> polygon;
+
+ // Just a normal polygon
+ test_self_intersects<polygon>("POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))", false);
+
+ // Self intersecting
+ test_self_intersects<polygon>("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>("POLYGON((0 2,2 4,2 0,4 2,0 2))", true);
+
+ // Self tangent
+ test_self_intersects<polygon>("POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))", true);
+
+ // Self tangent in corner
+ test_self_intersects<polygon>("POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))", true);
+
+ // With spike
+ test_self_intersects<polygon>("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>("POLYGON((0 0,0 4,4 0,4 0,0 0))", false);
+
+ // With many duplicates
+ test_self_intersects<polygon>(
+ "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>("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>("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>(
+ "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);
+}
+
+
+
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ //test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ //test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/intersects.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/intersects.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="intersects"
+ ProjectGUID="{B1A97F62-85CD-4239-BB56-619988B08260}"
+ RootNamespace="intersects"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersects"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersects"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\intersects.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/is_convex.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/is_convex.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,123 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <cstddef>
+#include <string>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/convex_hull.hpp>
+
+
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/util/as_range.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/stream_wkt.hpp>
+
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt,
+ std::size_t size_original, std::size_t size_hull,
+ double expected_area)
+{
+
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+
+ typedef typename boost::geometry::point_type<Geometry>::type P;
+ typename boost::geometry::strategy_side
+ <
+ typename boost::geometry::cs_tag<P>::type
+ >::type side;
+
+ typedef typename boost::geometry::range_type<Geometry>::type range_type;
+ typedef typename boost::range_const_iterator<range_type>::type iterator;
+
+ range_type const& range = boost::geometry::as_range<range_type>(geometry);
+
+ iterator it1 = boost::begin(range);
+ iterator it3 = it1++;
+ iterator it2 = it1++;
+
+ for (;
+ it2 != boost::end(range);
+ ++it1, ++it2, ++it3)
+ {
+ // Last/closing point
+ if (it1 == boost::end(range))
+ {
+ it1 = boost::begin(range) + 1;
+ }
+ int s = side.apply(*it1, *it2, *it3);
+
+ if (s != 1)
+ {
+ std::cout << "NOT CONVEX!";
+ }
+ if (s == 0)
+ {
+ std::cout << " COLLINEAR!";
+ }
+
+ std::cout
+ << " " << (*it3)
+ << " " << boost::geometry::wkt(*it2)
+ << " " << boost::geometry::wkt(*it1)
+ << " " << s
+ << std::endl;
+ }
+
+ std::cout << boost::geometry::area(geometry) << " " << boost::geometry::wkt(geometry) << std::endl;
+}
+
+template <typename P>
+void test_all()
+{
+ // rectangular, with concavity
+ test_geometry<boost::geometry::polygon<P> >(
+ "polygon((1 1, 1 4, 3 4, 3 3, 4 3, 4 4, 5 4, 5 1, 1 1))",
+ 9, 5, 12.0);
+
+
+ // concavity at start/closing point
+ test_geometry<boost::geometry::polygon<P> >(
+ "polygon((1 1,0 2,3 3,1 0,1 1))", 9, 5, 12.0);
+
+ // from sample polygon, with concavity
+ test_geometry<boost::geometry::polygon<P> >(
+ "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);
+}
+
+int test_main(int, char* [])
+{
+ //test_all<boost::geometry::point_xy<int> >();
+ //test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ // GMP compiles but gives errors in results
+ // TODO: find out what's going wrong here
+ // test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/is_convex.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/is_convex.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="is_convex"
+ ProjectGUID="{65EAD0CE-1AC7-4997-B618-55712AD7D8EA}"
+ RootNamespace="is_convex"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\is_convex"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\is_convex"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\is_convex.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/length.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/length.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,45 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <algorithms/test_length.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/std_pair_as_segment.hpp>
+
+
+
+
+template <typename P>
+void test_all()
+{
+ // 3-4-5 triangle
+ test_geometry<std::pair<P, P> >("LINESTRING(0 0,3 4)", 5);
+
+ // 3-4-5 plus 1-1
+ test_geometry<boost::geometry::linestring<P> >("LINESTRING(0 0,3 4,4 3)", 5 + sqrt(2.0));
+
+ // Geometries with length zero
+ test_geometry<P>("POINT(0 0)", 0);
+ test_geometry<boost::geometry::polygon<P> >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 0);
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/length.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/length.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="length"
+ ProjectGUID="{C4D75B1E-34D5-4A98-8535-A9535BE949E4}"
+ RootNamespace="length"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\length"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\length"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\length.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/make.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/make.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,125 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/make.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+using namespace boost::geometry;
+
+template <typename T, typename P>
+void test_point_2d()
+{
+ P p = make<P>((T) 123, (T) 456);
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 123, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 456, 1.0e-6);
+
+}
+
+template <typename T, typename P>
+void test_point_3d()
+{
+ P p = make<P>((T) 123, (T) 456, (T) 789);
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 123, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 456, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<2>(p)), (double) 789, 1.0e-6);
+}
+
+template <typename T, typename P>
+void test_box_2d()
+{
+ typedef box<P> B;
+ B b = make<B>((T) 123, (T) 456, (T) 789, (T) 1011);
+ BOOST_CHECK_CLOSE( ((double) get<min_corner, 0>(b)), (double) 123, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<min_corner, 1>(b)), (double) 456, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<max_corner, 0>(b)), (double) 789, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<max_corner, 1>(b)), (double) 1011, 1.0e-6);
+
+ b = make_inverse<B>();
+}
+
+template <typename T, typename P>
+void test_linestring_2d()
+{
+ typedef linestring<P> L;
+
+ T coors[][2] = {{1,2}, {3,4}};
+
+ L line = make<L>(coors);
+
+ BOOST_CHECK_EQUAL(line.size(), 2);
+}
+
+template <typename T, typename P>
+void test_linestring_3d()
+{
+ typedef linestring<P> L;
+
+ T coors[][3] = {{1,2,3}, {4,5,6}};
+
+ L line = make<L>(coors);
+
+ BOOST_CHECK_EQUAL(line.size(), 2);
+ //std::cout << dsv(line) << std::endl;
+
+}
+
+template <typename T, typename P>
+void test_2d_t()
+{
+ test_point_2d<T, P>();
+ test_box_2d<T, P>();
+ test_linestring_2d<T, P>();
+}
+
+template <typename P>
+void test_2d()
+{
+ test_2d_t<int, P>();
+ test_2d_t<float, P>();
+ test_2d_t<double, P>();
+}
+
+template <typename T, typename P>
+void test_3d_t()
+{
+ test_linestring_3d<T, P>();
+// test_point_3d<T, test_point>();
+}
+
+template <typename P>
+void test_3d()
+{
+ test_3d_t<int, P>();
+ test_3d_t<float, P>();
+ test_3d_t<double, P>();
+}
+
+int test_main(int, char* [])
+{
+ //test_2d<int[2]>();
+ //test_2d<float[2]>();
+ //test_2d<double[2]>();
+ test_2d<point<int, 2, cs::cartesian> >();
+ test_2d<point<float, 2, cs::cartesian> >();
+ test_2d<point<double, 2, cs::cartesian> >();
+
+
+ test_3d<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/make.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/make.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="make"
+ ProjectGUID="{BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}"
+ RootNamespace="make"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\make"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\make"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\make.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlaps.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlaps.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,63 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <algorithms/test_overlaps.hpp>
+
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/linestring.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+
+template <typename P>
+void test_2d()
+{
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1, 3 3)", "BOX(0 0,2 2)", true);
+
+ // touch -> false
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1, 3 3)", "BOX(3 3,5 5)", false);
+
+ // disjoint -> false
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1, 3 3)", "BOX(4 4,6 6)", false);
+
+ // within -> false
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1, 5 5)", "BOX(2 2,3 3)", false);
+
+ // within+touch -> false
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1, 5 5)", "BOX(2 2,5 5)", false);
+}
+
+template <typename P>
+void test_3d()
+{
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(0 0 0,2 2 2)", true);
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(3 3 3,5 5 5)", false);
+ test_geometry<boost::geometry::box<P>, boost::geometry::box<P> >("BOX(1 1 1, 3 3 3)", "BOX(4 4 4,6 6 6)", false);
+}
+
+
+
+int test_main( int , char* [] )
+{
+ test_2d<boost::geometry::point_xy<int> >();
+ test_2d<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ test_2d<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ test_2d<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ //test_3d<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlaps.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlaps.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="overlaps"
+ ProjectGUID="{30C37854-9ED6-4C1E-97FB-BF8637BD5811}"
+ RootNamespace="overlaps"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\overlaps"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\overlaps"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\overlaps.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,164 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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 <iostream>
+#include <iomanip>
+#include <string>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/foreach.hpp>
+
+#include <boost/geometry/algorithms/correct.hpp>
+#include <boost/geometry/algorithms/intersection.hpp>
+#include <boost/geometry/algorithms/union.hpp>
+#include <boost/geometry/algorithms/intersects.hpp>
+#include <boost/geometry/algorithms/within.hpp>
+
+#include <boost/geometry/geometries/cartesian2d.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+template <typename Geometry>
+inline void test_assemble(std::string const& id, Geometry const& p, Geometry const& q)
+{
+ namespace bg = boost::geometry;
+
+ std::vector<Geometry> u, i;
+ bg::union_inserter<Geometry>(p, q, std::back_inserter(u));
+ bg::intersection_inserter<Geometry>(p, q, std::back_inserter(i));
+
+ typedef bg::coordinate_type<Geometry>::type type;
+ type area_p = bg::area(p);
+ type area_q = bg::area(q);
+ type area_i = 0;
+ type area_u = 0;
+
+ BOOST_FOREACH(Geometry const& g, u)
+ {
+ area_u += bg::area(g);
+ }
+ BOOST_FOREACH(Geometry const& g, i)
+ {
+ area_i += bg::area(g);
+ }
+
+ double diff = (area_p + area_q) - area_u - area_i;
+ BOOST_CHECK_CLOSE(diff, 0.0, 0.0001);
+ if (abs(diff) > 0.001)
+ {
+ std::cout
+ << id << std::endl
+ << bg::wkt(p) << std::endl
+ << bg::wkt(q) << std::endl;
+ }
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "assemble_" << id << ".svg";
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<typename boost::geometry::point_type<Geometry>::type> mapper(svg, 500, 500);
+ mapper.add(p);
+ mapper.add(q);
+ mapper.map(p, "fill-opacity:0.6;stroke-opacity:0.9;fill:rgb(0,0,255);stroke:rgb(0,0,255);stroke-width:2");
+ mapper.map(q, "fill-opacity:0.6;stroke-opacity:0.9;fill:rgb(0,255,0);stroke:rgb(0,255,0);stroke-width:2");
+ BOOST_FOREACH(Geometry const& geometry, u)
+ {
+ mapper.map(geometry,
+ "stroke-opacity:0.6;fill:none;stroke:rgb(255,0,255);stroke-width:5");
+ }
+ BOOST_FOREACH(Geometry const& geometry, i)
+ {
+ mapper.map(geometry,
+ "stroke-opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5");
+ }
+ }
+#endif
+}
+
+template <typename Polygon>
+inline bool int_ok(Polygon const& poly)
+{
+ namespace bg = boost::geometry;
+
+ typename bg::point_type<Polygon>::type const& pi =
+ bg::interior_rings(poly)[0].front();
+
+ return bg::within(pi, bg::exterior_ring(poly));
+}
+
+
+
+void generate()
+{
+ namespace bg = boost::geometry;
+
+ 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] + ")";
+
+ bg::polygon_2d p, q;
+ bg::read_wkt(ps, p);
+ bg::read_wkt(qs, q);
+ bg::correct(p);
+ bg::correct(q);
+ if (! intersects(p)
+ && ! intersects(q)
+ && int_ok(p)
+ && int_ok(q)
+ )
+ {
+ std::ostringstream out;
+ out << pe << qe << pi << qi;
+ test_assemble(out.str(), p, q);
+
+ }
+ }
+ }
+ }
+ }
+}
+
+
+#if ! defined(GGL_TEST_MULTI)
+int test_main(int, char* [])
+{
+ generate();
+ return 0;
+}
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="assemble"
+ ProjectGUID="{306E829F-ACEC-42D5-B1D4-2531B2F56EA3}"
+ RootNamespace="assemble"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\assemble"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\assemble"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\assemble.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,181 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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 <iostream>
+#include <iomanip>
+#include <string>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/foreach.hpp>
+
+#include <boost/geometry/algorithms/intersection.hpp>
+#include <boost/geometry/algorithms/dissolve.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+template <typename Geometry>
+inline void test_dissolve(std::string const& id,
+ int expected_count, double expected_area,
+ Geometry const& geometry, double precision)
+{
+ namespace bg = boost::geometry;
+
+ std::vector<Geometry> out;
+ bg::dissolve(geometry, std::back_inserter(out));
+
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "dissolve_" << id << ".svg";
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<typename boost::geometry::point_type<Geometry>::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(Geometry const& geometry, out)
+ {
+ // Light red plus dark black outline gives clear impression
+ mapper.map(geometry,
+ "fill-opacity:0.1;fill:rgb(255,0,0);"
+ "stroke-opacity:0.9;stroke:rgb(0,0,0);stroke-width:3");
+ }
+ }
+#endif
+}
+
+
+
+template <typename Geometry>
+void test_geometry(std::string const& id, int expected_count, double expected_area,
+ std::string const& wkt, double precision = 0.001)
+{
+ if (wkt.empty())
+ {
+ return;
+ }
+
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+
+ std::string caseid = id;
+
+//#ifdef GGL_DEBUG_INTERSECTION
+ std::cout << std::endl << std::endl << "# " << caseid << std::endl;
+//#endif
+ test_dissolve(caseid, expected_count, expected_area, geometry, precision);
+}
+
+
+#if ! defined(GGL_TEST_MULTI)
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::linear_ring<P> ring;
+ typedef boost::geometry::polygon<P> polygon;
+
+ test_geometry<polygon>("case_1", 2, 2.96969697,
+ "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))");
+ return;
+
+ // Just a normal polygon
+ test_geometry<polygon>("1", 0, 0,
+ "POLYGON((0 0,0 4,1.5 2.5,2.5 1.5,4 0,0 0))");
+
+
+ // Self intersecting
+ test_geometry<polygon>("2", 2, 2.125,
+ "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_geometry<polygon>("3", 1, 2,
+ "POLYGON((0 2,2 4,2 0,4 2,0 2))");
+
+
+ // Self tangent
+ test_geometry<polygon>("4", 1, 4,
+ "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))");
+
+
+ // Self tangent in corner
+ test_geometry<polygon>("5", 1, 4,
+ "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))");
+
+
+ // With spike
+ test_geometry<polygon>("6", 1, 2,
+ "POLYGON((0 0,0 4,4 4,4 2,6 2,4 2,4 0,0 0))");
+
+
+ // Non intersection, but with duplicate
+ test_geometry<polygon>("d1", 0, 0,
+ "POLYGON((0 0,0 4,4 0,4 0,0 0))");
+
+
+ // With many duplicates
+ test_geometry<polygon>("d2", 0, 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_geometry<polygon>("h1", 2, 4,
+ "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))");
+
+
+ // Hole: interior intersecting exterior
+ test_geometry<polygon>("h2", 4, 3.5,
+ "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,1 3,5 4,1 1))");
+
+
+ // Hole: two intersecting holes
+ test_geometry<polygon>("h3", 4, 2.5,
+ "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_geometry<polygon>("h4", 2, 2.96969697,
+ "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))");
+
+
+ test_geometry<polygon>("toolkit_1", 2, 2.96969697,
+ "POLYGON((166445 554833,166445 554833,164795 555594,166448 554831,166439 554802,166439 554803,166439 554802,166439 554802,166425 554745,166425 554745,166425 554745,166425 554745,166417 554697,166405 554657,166405 554657,166405 554657,166405 554657,166405 554657,166405 554657,166402 554637,166361 554653,166364 554659,166400 554644,166405 554637,166404 554632,166360 554650,166319 554668,166291 554685,166292 554685,166276 554692,166276 554692,166260 554698,166215 554716,166201 554727,166195 554734,166194 554742,166196 554755,166198 554772,166200 554780,166220 554852,166224 554858,166224 554858,166226 554861,166226 554861,166228 554865,166233 554872,166240 554873,166282 554868,166292 554865,166292 554865,166297 554864,166297 554864,166304 554863,166304 554863,166315 554861,166314 554861,166341 554859,166389 554845,166388 554845,166411 554843,166411 554843,166425 554844,166435 554841,166441 554838,166441 554838,166444 554836,166444 554836,166447 554835,166443 554827,166440 554828,166443 554834,166445
 554833))");
+
+ test_geometry<polygon>("toolkit_2", 2, 2.96969697,
+ "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.332
44019 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_geometry<polygon>("ticket17", 2, 37.38691, ticket17);
+
+
+}
+#endif
+
+
+
+#if ! defined(GGL_TEST_MULTI)
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<double> >();
+ return 0;
+}
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/dissolve.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="dissolve"
+ ProjectGUID="{206F83D5-17F9-4856-A1DE-82301DB94439}"
+ RootNamespace="dissolve"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\dissolve"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\dissolve"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\dissolve.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,180 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/intersection.hpp>
+
+//#include <boost/geometry/algorithms/overlay/get_intersection_points.hpp>
+//#include <boost/geometry/algorithms/overlay/merge_intersection_points.hpp>
+#include <boost/geometry/algorithms/overlay/enrich_intersection_points.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#define GGL_TEST_OVERLAY_NOT_REVERSED
+
+#include <overlay_common.hpp>
+
+#include <boost/algorithm/string/replace.hpp>
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+struct test_enrich_intersection_points
+{
+ static inline std::string dir(int d)
+ {
+ return d == 0 ? "-" : (d == 1 ? "L" : "R");
+ }
+
+ template <typename G1, typename G2>
+ static void apply(std::string const& id,
+ boost::tuple<int, std::string> const& expected_count_and_center,
+ G1 const& g1, G2 const& g2, double precision)
+ {
+ //std::cout << "#" << id << std::endl;
+
+ typedef boost::geometry::detail::intersection::intersection_point
+ <typename boost::geometry::point_type<G2>::type> ip;
+ typedef typename boost::range_const_iterator<std::vector<ip> >::type iterator;
+ std::vector<ip> ips;
+
+ boost::geometry::get_intersection_points(g1, g2, ips);
+ boost::geometry::merge_intersection_points(ips);
+ boost::geometry::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());
+
+ svg_mapper<typename boost::geometry::point_type<G2>::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<boost::tuple<int, std::string> > 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<boost::geometry::point_xy<float>, test_enrich_intersection_points>(expected);
+ test_all<boost::geometry::point_xy<double>, test_enrich_intersection_points>(expected);
+ //test_all<boost::tuple<double, double>, test_enrich_intersection_points>(expected);
+
+ */
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="enrich_intersection_points"
+ ProjectGUID="{20FE798A-E4EE-4C87-A988-7317E774D28A}"
+ RootNamespace="enrich_intersection_points"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\enrich_intersection_points"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\enrich_intersection_points"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\enrich_intersection_points.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,848 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <iostream>
+
+#include <ggl_test_common.hpp>
+
+
+#include <boost/foreach.hpp>
+
+#include <boost/geometry/algorithms/intersection.hpp>
+
+#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+
+
+template <typename P, typename T>
+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,
+ boost::geometry::detail::overlay::method_type expected_method,
+ T ip_x, T ip_y,
+ std::string const& expected,
+ T ip_x2, T ip_y2)
+{
+ namespace bg = boost::geometry;
+ P pi = bg::make<P>(pi_x, pi_y);
+ P pj = bg::make<P>(pj_x, pj_y);
+ P pk = bg::make<P>(pk_x, pk_y);
+ P qi = bg::make<P>(qi_x, qi_y);
+ P qj = bg::make<P>(qj_x, qj_y);
+ P qk = bg::make<P>(qk_x, qk_y);
+
+
+ typedef bg::detail::overlay::turn_info<P> turn_info;
+ typedef std::vector<turn_info> tp_vector;
+ turn_info model;
+ tp_vector info;
+ bg::detail::overlay::get_turn_info<P, P, turn_info>::apply(pi, pj, pk, qi, qj, qk,
+ model, std::back_inserter(info));
+
+
+ if (info.size() == 0)
+ {
+ BOOST_CHECK_EQUAL(expected_method,
+ boost::geometry::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);
+ }
+ }
+
+
+ /*
+ std::cout << caseid
+ << (caseid.find("_") == std::string::npos ? " " : "")
+ << " " << method
+ << " " << detected
+ << " " << order
+ << std::endl;
+ */
+
+
+ BOOST_CHECK_EQUAL(detected, expected);
+
+ if (! info.empty())
+ {
+ BOOST_CHECK_EQUAL(info[0].method, expected_method);
+ 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(), 2);
+ 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<typename boost::geometry::coordinate_type<P>::type>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<P> mapper(svg, 500, 500);
+ mapper.add(bg::make<P>(0, 0));
+ mapper.add(bg::make<P>(10, 10));
+
+ bg::linestring<P> p; p.push_back(pi); p.push_back(pj); p.push_back(pk);
+ bg::linestring<P> 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);
+ 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 <typename P, typename T>
+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,
+ boost::geometry::detail::overlay::method_type method
+ = boost::geometry::detail::overlay::method_none,
+ T ip_x = -1, T ip_y = -1,
+ std::string const& expected = "",
+ T ip_x2 = -1, T ip_y2 = -1)
+{
+ test_with_point<P, double>(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, ip_x, ip_y, expected, ip_x2, ip_y2);
+
+ //return;
+
+ std::string reverse;
+ for (int i = expected.size() - 1; i >= 0; i--)
+ {
+ reverse += expected[i];
+ }
+ if (ip_x2 >= 0 && ip_y2 >= 0)
+ {
+ std::swap(ip_x, ip_x2);
+ std::swap(ip_y, ip_y2);
+ }
+
+ test_with_point<P, double>(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, ip_x, ip_y, reverse, ip_x2, ip_y2);
+}
+
+
+template <typename P>
+void test_all()
+{
+ using namespace boost::geometry::detail::overlay;
+
+ // See powerpoint "doc/testcases/get_turn_info.ppt"
+
+
+ // ------------------------------------------------------------------------
+ // "Real" intersections ("i"), or, crossing
+ // ------------------------------------------------------------------------
+ test_both<P, double>("il1",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 3, 7, 5, 8, 3, // q
+ method_crosses, 5, 4, "ui");
+
+ test_both<P, double>("il2",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 5, 7, 5, 3, 3, // q
+ method_crosses, 5, 5, "ui");
+
+ test_both<P, double>("il3",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 3, 7, 5, 3, 5, // q
+ method_crosses, 5, 4, "ui");
+
+ test_both<P, double>("il4",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 3, 7, 5, 4, 8, // q
+ method_crosses, 5, 4, "ui");
+
+ test_both<P, double>("ir1",
+ 5, 1, 5, 6, 7, 8, // p
+ 7, 5, 3, 3, 2, 5, // q
+ method_crosses, 5, 4, "iu");
+
+
+ // ------------------------------------------------------------------------
+ // TOUCH INTERIOR or touch in the middle ("m")
+ // ------------------------------------------------------------------------
+ test_both<P, double>("ml1",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 3, 5, 4, 7, 3, // q
+ method_touch_interior, 5, 4, "ui");
+
+ test_both<P, double>("ml2",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 3, 5, 4, 3, 6, // q
+ method_touch_interior, 5, 4, "iu");
+
+ test_both<P, double>("ml3",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 6, 5, 4, 3, 3, // q
+ method_touch_interior, 5, 4, "uu");
+
+ test_both<P, double>("mr1",
+ 5, 1, 5, 6, 7, 8, // p
+ 7, 3, 5, 4, 3, 3, // q
+ method_touch_interior, 5, 4, "iu");
+
+ test_both<P, double>("mr2",
+ 5, 1, 5, 6, 7, 8, // p
+ 7, 3, 5, 4, 7, 6, // q
+ method_touch_interior, 5, 4, "ui");
+
+ test_both<P, double>("mr3",
+ 5, 1, 5, 6, 7, 8, // p
+ 7, 6, 5, 4, 7, 3, // q
+ method_touch_interior, 5, 4, "ii");
+
+ test_both<P, double>("mcl",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 2, 5, 3, 5, 5, // q
+ method_touch_interior, 5, 3, "cc");
+
+ test_both<P, double>("mcr",
+ 5, 1, 5, 6, 7, 8, // p
+ 7, 2, 5, 3, 5, 5, // q
+ method_touch_interior, 5, 3, "cc");
+
+ test_both<P, double>("mclo",
+ 5, 1, 5, 6, 7, 8, // p
+ 3, 4, 5, 5, 5, 3, // q
+ method_touch_interior, 5, 5, "ux");
+
+ test_both<P, double>("mcro",
+ 5, 1, 5, 6, 7, 8, // p
+ 7, 4, 5, 5, 5, 3, // q
+ method_touch_interior, 5, 5, "ix");
+
+ // ------------------------------------------------------------------------
+ // COLLINEAR
+ // ------------------------------------------------------------------------
+ test_both<P, double>("cll1",
+ 5, 1, 5, 6, 3, 8, // p
+ 5, 5, 5, 7, 3, 8, // q
+ method_collinear, 5, 6, "ui");
+ test_both<P, double>("cll2",
+ 5, 1, 5, 6, 3, 8, // p
+ 5, 3, 5, 5, 3, 6, // q
+ method_collinear, 5, 5, "iu");
+ test_both<P, double>("clr1",
+ 5, 1, 5, 6, 3, 8, // p
+ 5, 5, 5, 7, 6, 8, // q
+ method_collinear, 5, 6, "ui");
+ test_both<P, double>("clr2",
+ 5, 1, 5, 6, 3, 8, // p
+ 5, 3, 5, 5, 6, 6, // q
+ method_collinear, 5, 5, "ui");
+
+ test_both<P, double>("crl1",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 5, 5, 7, 3, 8, // q
+ method_collinear, 5, 6, "iu");
+ test_both<P, double>("crl2",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 3, 5, 5, 3, 6, // q
+ method_collinear, 5, 5, "iu");
+ test_both<P, double>("crr1",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 5, 5, 7, 6, 8, // q
+ method_collinear, 5, 6, "iu");
+ test_both<P, double>("crr2",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 3, 5, 5, 6, 6, // q
+ method_collinear, 5, 5, "ui");
+
+ test_both<P, double>("ccx1",
+ 5, 1, 5, 6, 5, 8, // p
+ 5, 5, 5, 7, 3, 8, // q
+ method_collinear, 5, 6, "cc");
+ test_both<P, double>("cxc1",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 3, 5, 5, 5, 7, // q
+ method_collinear, 5, 5, "cc");
+
+ // Bug in case #54 of "overlay_cases.hpp"
+ test_both<P, double>("c_bug1",
+ 5, 0, 2, 0, 2, 2, // p
+ 4, 0, 1, 0, 1, 2, // q
+ method_collinear, 2, 0, "iu");
+
+
+ // ------------------------------------------------------------------------
+ // COLLINEAR OPPOSITE
+ // ------------------------------------------------------------------------
+
+ test_both<P, double>("clo1",
+ 5, 2, 5, 6, 3, 8, // p
+ 5, 7, 5, 5, 3, 3, // q
+ method_collinear, 5, 6, "ixxu", 5, 5);
+ test_both<P, double>("clo2",
+ 5, 2, 5, 6, 3, 8, // p
+ 5, 7, 5, 5, 5, 2, // q
+ method_collinear, 5, 6, "ix");
+ // actually "xxix", xx is skipped everywhere
+ test_both<P, double>("clo3",
+ 5, 2, 5, 6, 3, 8, // p
+ 5, 7, 5, 5, 7, 3, // q
+ method_collinear, 5, 6, "ixxi", 5, 5);
+
+ test_both<P, double>("cco1",
+ 5, 2, 5, 6, 5, 8, // p
+ 5, 7, 5, 5, 3, 3, // q
+ method_collinear, 5, 5, "xu"); // "xuxx"
+ test_both<P, double>("cco2",
+ 5, 2, 5, 6, 5, 8, // p
+ 5, 7, 5, 5, 5, 2); // q "xxxx"
+ test_both<P, double>("cco3",
+ 5, 2, 5, 6, 5, 8, // p
+ 5, 7, 5, 5, 7, 3, // q
+ method_collinear, 5, 5, "xi"); // "xixx"
+
+
+ test_both<P, double>("cro1",
+ 5, 2, 5, 6, 7, 8, // p
+ 5, 7, 5, 5, 3, 3, // q
+ method_collinear, 5, 6, "uxxu", 5, 5);
+ test_both<P, double>("cro2",
+ 5, 2, 5, 6, 7, 8, // p
+ 5, 7, 5, 5, 5, 2, // q
+ method_collinear, 5, 6, "ux"); // "xxux"
+ test_both<P, double>("cro3",
+ 5, 2, 5, 6, 7, 8, // p
+ 5, 7, 5, 5, 7, 3, // q
+ method_collinear, 5, 6, "uxxi", 5, 5);
+
+ test_both<P, double>("cxo1",
+ 5, 2, 5, 6, 3, 8, // p
+ 5, 5, 5, 3, 3, 1, // q
+ method_collinear, 5, 3, "xu");
+ test_both<P, double>("cxo2",
+ 5, 2, 5, 6, 3, 8, // p
+ 5, 5, 5, 3, 5, 0); // q "xx"
+ test_both<P, double>("cxo3",
+ 5, 2, 5, 6, 3, 8, // p
+ 5, 5, 5, 3, 7, 1, // q
+ method_collinear, 5, 3, "xi");
+
+ test_both<P, double>("cxo4",
+ 5, 2, 5, 6, 3, 8, // p
+ 5, 7, 5, 1, 3, 0, // q
+ method_collinear, 5, 6, "ix");
+ test_both<P, double>("cxo5",
+ 5, 2, 5, 6, 5, 8, // p
+ 5, 7, 5, 1, 3, 0); // q "xx"
+ test_both<P, double>("cxo6",
+ 5, 2, 5, 6, 7, 8, // p
+ 5, 7, 5, 1, 3, 0, // q
+ method_collinear, 5, 6, "ux");
+
+
+ // Verify
+ test_both<P, double>("cvo1",
+ 5, 3, 5, 7, 7, 9, // p
+ 5, 5, 5, 3, 3, 1 // q
+ );
+ test_both<P, double>("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<P, double>("blr1",
+ 5, 1, 5, 6, 4, 4, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("blr2",
+ 5, 1, 5, 6, 1, 4, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("blr3",
+ 5, 1, 5, 6, 3, 6, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("blr4",
+ 5, 1, 5, 6, 1, 8, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "xu");
+ test_both<P, double>("blr5",
+ 5, 1, 5, 6, 4, 8, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "uu");
+ test_both<P, double>("blr6",
+ 5, 1, 5, 6, 6, 4, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "uu");
+
+ test_both<P, double>("blr7",
+ 5, 1, 5, 6, 3, 6, // p
+ 3, 7, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ix");
+ test_both<P, double>("blr8",
+ 5, 1, 5, 6, 3, 6, // p
+ 3, 6, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "xx");
+ test_both<P, double>("blr9",
+ 5, 1, 5, 6, 3, 6, // p
+ 3, 5, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ux");
+
+ // Variants
+ test_both<P, double>("blr7-a",
+ 5, 1, 5, 6, 3, 6, // p
+ 5, 8, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ix");
+ test_both<P, double>("blr7-b", // in fact NOT "both-left"
+ 5, 1, 5, 6, 3, 6, // p
+ 6, 8, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ix");
+
+ // To check if "collinear-check" on other side
+ // does not apply to this side
+ test_both<P, double>("blr6-c1",
+ 5, 1, 5, 6, 7, 5, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "uu");
+ test_both<P, double>("blr6-c2",
+ 5, 1, 5, 6, 7, 7, // p
+ 3, 7, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "uu");
+
+
+
+ // Both right, Q turns right
+ test_both<P, double>("brr1",
+ 5, 1, 5, 6, 6, 4, // p
+ 7, 5, 5, 6, 7, 7, // q
+ method_touch, 5, 6, "uu");
+ test_both<P, double>("brr2",
+ 5, 1, 5, 6, 9, 4, // p
+ 7, 5, 5, 6, 7, 7, // q
+ method_touch, 5, 6, "xu");
+ test_both<P, double>("brr3",
+ 5, 1, 5, 6, 7, 6, // p
+ 7, 5, 5, 6, 7, 7, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("brr4",
+ 5, 1, 5, 6, 9, 8, // p
+ 7, 5, 5, 6, 7, 7, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("brr5",
+ 5, 1, 5, 6, 6, 8, // p
+ 7, 5, 5, 6, 7, 7, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("brr6",
+ 5, 1, 5, 6, 4, 4, // p
+ 7, 5, 5, 6, 7, 7, // q
+ method_touch, 5, 6, "ui");
+
+ // Both right, Q turns left
+ test_both<P, double>("brl1",
+ 5, 1, 5, 6, 6, 4, // p
+ 7, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("brl2",
+ 5, 1, 5, 6, 9, 4, // p
+ 7, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("brl3",
+ 5, 1, 5, 6, 7, 6, // p
+ 7, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("brl4",
+ 5, 1, 5, 6, 9, 8, // p
+ 7, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "xi");
+ test_both<P, double>("brl5",
+ 5, 1, 5, 6, 6, 8, // p
+ 7, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "ii");
+ test_both<P, double>("brl6",
+ 5, 1, 5, 6, 4, 4, // p
+ 7, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "ii");
+ test_both<P, double>("brl7",
+ 5, 1, 5, 6, 7, 6, // p
+ 7, 7, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ux");
+ test_both<P, double>("brl8",
+ 5, 1, 5, 6, 7, 6, // p
+ 7, 6, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "xx");
+ test_both<P, double>("brl9",
+ 5, 1, 5, 6, 7, 6, // p
+ 7, 5, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ix");
+
+ // Variants
+ test_both<P, double>("brl7-a",
+ 5, 1, 5, 6, 7, 6, // p
+ 5, 8, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ux");
+ test_both<P, double>("brl7-b", // in fact NOT "both right"
+ 5, 1, 5, 6, 7, 6, // p
+ 4, 8, 5, 6, 5, 3, // q
+ method_touch, 5, 6, "ux");
+
+
+
+ // Both left, Q turns left
+ test_both<P, double>("bll1",
+ 5, 1, 5, 6, 4, 4, // p
+ 3, 5, 5, 6, 3, 7, // q
+ method_touch, 5, 6, "ii");
+ test_both<P, double>("bll2",
+ 5, 1, 5, 6, 1, 4, // p
+ 3, 5, 5, 6, 3, 7, // q
+ method_touch, 5, 6, "xi");
+ test_both<P, double>("bll3",
+ 5, 1, 5, 6, 3, 6, // p
+ 3, 5, 5, 6, 3, 7, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("bll4",
+ 5, 1, 5, 6, 1, 8, // p
+ 3, 5, 5, 6, 3, 7, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("bll5",
+ 5, 1, 5, 6, 4, 8, // p
+ 3, 5, 5, 6, 3, 7, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("bll6",
+ 5, 1, 5, 6, 6, 4, // p
+ 3, 5, 5, 6, 3, 7, // q
+ method_touch, 5, 6, "iu");
+
+ // TOUCH - COLLINEAR + one side
+ // Collinear/left, Q turns right
+ test_both<P, double>("t-clr1",
+ 5, 1, 5, 6, 4, 4, // p
+ 5, 8, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("t-clr2",
+ 5, 1, 5, 6, 1, 4, // p
+ 5, 8, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("t-clr3",
+ 5, 1, 5, 6, 3, 6, // p
+ 5, 8, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("t-clr4",
+ 5, 1, 5, 6, 5, 8, // p
+ 5, 8, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "xu");
+ // 5 n.a.
+ test_both<P, double>("t-clr6",
+ 5, 1, 5, 6, 6, 4, // p
+ 5, 8, 5, 6, 3, 5, // q
+ method_touch, 5, 6, "uu");
+
+ // Collinear/right, Q turns right
+ test_both<P, double>("t-crr1",
+ 5, 1, 5, 6, 6, 4, // p
+ 7, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "uu");
+ test_both<P, double>("t-crr2",
+ 5, 1, 5, 6, 9, 4, // p
+ 7, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "xu");
+ test_both<P, double>("t-crr3",
+ 5, 1, 5, 6, 7, 6, // p
+ 7, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("t-crr4",
+ 5, 1, 5, 6, 5, 9, // p
+ 7, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "cc");
+ // 5 n.a.
+ test_both<P, double>("t-crr6",
+ 5, 1, 5, 6, 4, 4, // p
+ 7, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "ui");
+
+ // Collinear/right, Q turns left
+ test_both<P, double>("t-crl1",
+ 5, 1, 5, 6, 6, 4, // p
+ 5, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("t-crl2",
+ 5, 1, 5, 6, 9, 4, // p
+ 5, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("t-crl3",
+ 5, 1, 5, 6, 7, 6, // p
+ 5, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("t-crl4",
+ 5, 1, 5, 6, 5, 8, // p
+ 5, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "xi");
+ // 5 n.a.
+ test_both<P, double>("t-crl6",
+ 5, 1, 5, 6, 4, 4, // p
+ 5, 7, 5, 6, 7, 5, // q
+ method_touch, 5, 6, "ii");
+
+ // Collinear/left, Q turns left
+ test_both<P, double>("t-cll1",
+ 5, 1, 5, 6, 4, 4, // p
+ 3, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "ii");
+ test_both<P, double>("t-cll2",
+ 5, 1, 5, 6, 1, 4, // p
+ 3, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "xi");
+ test_both<P, double>("t-cll3",
+ 5, 1, 5, 6, 3, 6, // p
+ 3, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("t-cll4",
+ 5, 1, 5, 6, 5, 9, // p
+ 3, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "cc");
+ // 5 n.a.
+ test_both<P, double>("t-cll6",
+ 5, 1, 5, 6, 6, 4, // p
+ 3, 5, 5, 6, 5, 8, // q
+ method_touch, 5, 6, "iu");
+
+ // Left to right
+ test_both<P, double>("lr1",
+ 5, 1, 5, 6, 3, 3, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "ii");
+ test_both<P, double>("lr2",
+ 5, 1, 5, 6, 1, 5, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "xi");
+ test_both<P, double>("lr3",
+ 5, 1, 5, 6, 4, 8, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("lr4",
+ 5, 1, 5, 6, 9, 5, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("lr5",
+ 5, 1, 5, 6, 7, 3, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "iu");
+ // otherwise case more thoroughly
+ test_both<P, double>("lr3a",
+ 5, 1, 5, 6, 1, 6, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("lr3b",
+ 5, 1, 5, 6, 5, 10, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("lr3c",
+ 5, 1, 5, 6, 8, 9, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("lr3d",
+ 5, 1, 5, 6, 9, 7, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("lr3e",
+ 5, 1, 5, 6, 9, 6, // p
+ 1, 5, 5, 6, 9, 5, // q
+ method_touch, 5, 6, "ui");
+
+ // Right to left
+ test_both<P, double>("rl1",
+ 5, 1, 5, 6, 3, 3, // p
+ 9, 5, 5, 6, 1, 5, // q
+ method_touch, 5, 6, "ui");
+ test_both<P, double>("rl2",
+ 5, 1, 5, 6, 1, 5, // p
+ 9, 5, 5, 6, 1, 5, // q
+ method_touch, 5, 6, "cc");
+ test_both<P, double>("rl3",
+ 5, 1, 5, 6, 4, 8, // p
+ 9, 5, 5, 6, 1, 5, // q
+ method_touch, 5, 6, "iu");
+ test_both<P, double>("rl4",
+ 5, 1, 5, 6, 9, 5, // p
+ 9, 5, 5, 6, 1, 5, // q
+ method_touch, 5, 6, "xu");
+ test_both<P, double>("rl5",
+ 5, 1, 5, 6, 7, 3, // p
+ 9, 5, 5, 6, 1, 5, // q
+ method_touch, 5, 6, "uu");
+
+ // Equal (p1/q1 are equal)
+ test_both<P, double>("ebl1",
+ 5, 1, 5, 6, 3, 4, // p
+ 5, 1, 5, 6, 3, 8, // q
+ method_equal, 5, 6, "ui");
+ test_both<P, double>("ebl2",
+ 5, 1, 5, 6, 3, 8, // p
+ 5, 1, 5, 6, 3, 4, // q
+ method_equal, 5, 6, "iu");
+ test_both<P, double>("ebl3",
+ 5, 1, 5, 6, 3, 8, // p
+ 5, 1, 5, 6, 3, 8, // q
+ method_equal, 5, 6, "cc");
+
+ test_both<P, double>("ebl3-c1",
+ 5, 1, 5, 6, 10, 1, // p
+ 5, 1, 5, 6, 3, 8, // q
+ method_equal, 5, 6, "iu");
+
+ test_both<P, double>("ebr1",
+ 5, 1, 5, 6, 7, 4, // p
+ 5, 1, 5, 6, 7, 8, // q
+ method_equal, 5, 6, "iu");
+ test_both<P, double>("ebr2",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 1, 5, 6, 7, 4, // q
+ method_equal, 5, 6, "ui");
+ test_both<P, double>("ebr3",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 1, 5, 6, 7, 8, // q
+ method_equal, 5, 6, "cc");
+
+ test_both<P, double>("ebr3-c1",
+ 5, 1, 5, 6, 0, 1, // p
+ 5, 1, 5, 6, 7, 8, // q
+ method_equal, 5, 6, "ui");
+
+ test_both<P, double>("elr1",
+ 5, 1, 5, 6, 7, 8, // p
+ 5, 1, 5, 6, 3, 8, // q
+ method_equal, 5, 6, "iu");
+ test_both<P, double>("elr2",
+ 5, 1, 5, 6, 3, 8, // p
+ 5, 1, 5, 6, 7, 8, // q
+ method_equal, 5, 6, "ui");
+ test_both<P, double>("ec1",
+ 5, 1, 5, 6, 5, 8, // p
+ 5, 1, 5, 6, 5, 8, // q
+ method_equal, 5, 6, "cc");
+ test_both<P, double>("ec2",
+ 5, 1, 5, 6, 5, 8, // p
+ 5, 1, 5, 6, 5, 7, // q
+ method_equal, 5, 6, "cc");
+
+ test_both<P, double>("snl-1",
+ 0, 3, 2, 3, 4, 3, // p
+ 4, 3, 2, 3, 0, 3, // q
+ method_touch, 2, 3, "xx");
+
+}
+
+
+/***
+#include <boost/geometry/geometries/adapted/c_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/c_array_as_ring.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+
+template <typename G>
+void test2(G const& geometry)
+{
+ typedef typename boost::geometry::point_type<G>::type P;
+ typedef typename boost::geometry::tag<G>::type T;
+ typedef typename boost::geometry::tag<P>::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 << boost::geometry::length(geometry) << std::endl;
+
+ typedef boost::geometry::point<float, 3, boost::geometry::cs::cartesian> P2;
+ boost::geometry::linestring<P2> out;
+ boost::geometry::strategy::transform::scale_transformer<float[3], P2> scaler(5);
+ boost::geometry::transform(geometry, out, scaler);
+ std::cout << boost::geometry::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<boost::geometry::point_xy<double> >();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="get_turn_info"
+ ProjectGUID="{8D98821A-5033-4616-9AF4-2AEAA42D8456}"
+ RootNamespace="get_turn_info"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\get_turn_info"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\get_turn_info"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\get_turn_info.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.xls
==============================================================================
Binary file. No diff available.

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,291 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <iomanip>
+
+#include <ggl_test_common.hpp>
+
+#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER
+
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/algorithms/overlay/get_turns.hpp>
+
+#include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
+
+
+#include <overlay_common.hpp>
+#include <overlay_cases.hpp>
+
+
+
+
+// To test that "get_turns" can be called using additional information
+template <typename P>
+struct my_turn_op : public boost::geometry::detail::overlay::turn_operation
+{
+};
+
+
+struct test_get_turns
+{
+ template <typename G1, typename G2>
+ static void apply(std::string const& id,
+ boost::tuple<int, double, double> const& expected_count_and_center,
+ G1 const& g1, G2 const& g2, double precision)
+ {
+ namespace bg = boost::geometry;
+ typedef bg::detail::overlay::turn_info
+ <
+ typename boost::geometry::point_type<G2>::type
+ > turn_info;
+ std::vector<turn_info> turns;
+
+ bg::detail::get_turns::no_interrupt_policy policy;
+ bg::get_turns<bg::detail::overlay::assign_null_policy>(g1, g2, turns, policy);
+
+ BOOST_CHECK_MESSAGE(
+ expected_count_and_center.get<0>() == boost::size(turns),
+ "get_turns: " << id
+ << " #turns expected: " << expected_count_and_center.get<0>()
+ << " detected: " << boost::size(turns)
+ << " type: " << string_from_type
+ <typename bg::coordinate_type<G1>::type>::name()
+ );
+
+
+ typedef typename bg::coordinate_type<G1>::type coordinate_type;
+ /*
+ coordinate_type x = 0, y = 0;
+ BOOST_FOREACH(turn_info const& turn, turns)
+ {
+ x += bg::get<0>(turn.point);
+ y += bg::get<1>(turn.point);
+ }
+
+ int n = boost::size(turns);
+ if (n > 0)
+ {
+ x /= n;
+ y /= n;
+ }
+ std::cout << std::setprecision(8) << x << ", " << y << " "
+ << expected_count_and_center.get<1>()
+ << " " << expected_count_and_center.get<2>()
+ << std::endl;
+ */
+
+
+ // Obsolete test (too much work)
+ //BOOST_CHECK_CLOSE(expected_count_and_center.get<1>(), x, precision);
+ //BOOST_CHECK_CLOSE(expected_count_and_center.get<2>(), y, precision);
+
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::map<std::pair<coordinate_type, coordinate_type>, int> offsets;
+ std::ostringstream filename;
+ filename << "get_turns_" << id
+ << "_" << string_from_type<typename bg::coordinate_type<G1>::type>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<typename bg::point_type<G2>::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");
+
+ 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<coordinate_type, coordinate_type> 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.ignore ? " (ignore) " : " ")
+ ;
+
+ 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
+ }
+};
+
+
+#if ! defined(GGL_TEST_MULTI)
+template <typename T>
+void test_all()
+{
+ typedef boost::geometry::point<T, 2, boost::geometry::cs::cartesian> P;
+ typedef boost::geometry::polygon<P> polygon;
+ typedef boost::geometry::linestring<P> linestring;
+ typedef boost::geometry::box<P> box;
+
+ // Expected count, average x, average y
+ typedef boost::tuple<int, double, double> Tuple;
+
+ std::cout << string_from_type<T>::name() << std::endl;
+
+
+ // snl
+ /*
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("snl_2",
+ boost::make_tuple(5, -122.27866617838542, 37.377897262573242),
+ //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,18491
9.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,185
027.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 6069
60.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.5560000019904
691725969314575195 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.30099
999904632568359375))"
+ );
+
+
+ return;
+ */
+
+ // 1-6
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("1", boost::make_tuple(6, 2.2547802, 3.0358056), case_1[0], case_1[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("2", boost::make_tuple(8, 2.5, 2.5), case_2[0], case_2[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("3", boost::make_tuple(4, 2.5, 2.5), case_3[0], case_3[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("4", boost::make_tuple(12, 2.5, 2.5), case_4[0], case_4[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("5", boost::make_tuple(17, 2.5987395, 2.4166667), case_5[0], case_5[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("6", boost::make_tuple(3, 3, 2.5), case_6[0], case_6[1]);
+
+ // 7-12
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("7", boost::make_tuple(2, 3, 2.5), case_7[0], case_7[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("8", boost::make_tuple(2, 2, 2), case_8[0], case_8[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("9", boost::make_tuple(1, 2, 2), case_9[0], case_9[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("10", boost::make_tuple(3, 2, 2), case_10[0], case_10[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("11", boost::make_tuple(1, 2, 2), case_11[0], case_11[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("12", boost::make_tuple(8, 2, 3.25), case_12[0], case_12[1]);
+
+ // 13-18
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("13", boost::make_tuple(2, 1.5, 1.5), case_13[0], case_13[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("14", boost::make_tuple(2, 2, 2), case_14[0], case_14[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("15", boost::make_tuple(2, 2, 2), case_15[0], case_15[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("16", boost::make_tuple(4, 1.5, 2.5), case_16[0], case_16[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("17", boost::make_tuple(2, 2, 2), case_17[0], case_17[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("18", boost::make_tuple(4, 2, 2), case_18[0], case_18[1]);
+
+ // 19-24
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("19", boost::make_tuple(2, 3, 2.5), case_19[0], case_19[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("20", boost::make_tuple(3, 0, 0), case_20[0], case_20[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("21", boost::make_tuple(3, 0, 0), case_21[0], case_21[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("22", boost::make_tuple(1, 4, 2), case_22[0], case_22[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("23", boost::make_tuple(2, 3.2, 2.2), case_23[0], case_23[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("24", boost::make_tuple(1, 4, 2), case_24[0], case_24[1]);
+
+ // 25-30
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("25", boost::make_tuple(1, 4, 2), case_25[0], case_25[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("26", boost::make_tuple(1, 4, 2), case_26[0], case_26[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("27", boost::make_tuple(2, 3.04545, 1.36363), case_27[0], case_27[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("28", boost::make_tuple(2, 3.04545, 1.36363), case_28[0], case_28[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("29", boost::make_tuple(2, 3.2, 2.2), case_29[0], case_29[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("30", boost::make_tuple(2, 2, 1.75), case_30[0], case_30[1]);
+
+ // 31-36
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("31", boost::make_tuple(1, 2, 2), case_31[0], case_31[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("32", boost::make_tuple(1, 2, 2), case_32[0], case_32[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("33", boost::make_tuple(1, 2, 2), case_33[0], case_33[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("34", boost::make_tuple(2, 3.5, 1.5), case_34[0], case_34[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("35", boost::make_tuple(1, 4, 2), case_35[0], case_35[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("36", boost::make_tuple(3, 2.55555, 2.36111), case_36[0], case_36[1]);
+
+ // 37-42
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("37", boost::make_tuple(3, 2.4444444, 2.0), case_37[0], case_37[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("38", boost::make_tuple(3, 3.18095239, 2.8380952), case_38[0], case_38[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("39", boost::make_tuple(4, 5.33333, 4.0), case_39[0], case_39[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("40", boost::make_tuple(3, 5.33333, 4.0), case_40[0], case_40[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("41", boost::make_tuple(5, 5.33333, 4.0), case_41[0], case_41[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("42", boost::make_tuple(5, 5.33333, 4.0), case_42[0], case_42[1]);
+
+ // 43-48
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("43", boost::make_tuple(4, 2.125, 1.9375), case_43[0], case_43[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("44", boost::make_tuple(4, 1.5, 1.5), case_44[0], case_44[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("45", boost::make_tuple(4, 1.5, 1.5), case_45[0], case_45[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("46", boost::make_tuple(4, 2.25, 1.5), case_46[0], case_46[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("47", boost::make_tuple(5, 2.6, 1.5), case_47[0], case_47[1]);
+
+ // 49-54
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("50", boost::make_tuple(4, 0.0, 0.0), case_50[0], case_50[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("51", boost::make_tuple(3, 0.0, 0.0), case_51[0], case_51[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("52", boost::make_tuple(8, 0.0, 0.0), case_52[0], case_52[1]);
+ // A touching point interior/ring exterior/ring can be represented in two ways:
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("53a", boost::make_tuple(4, 0.0, 0.0), case_53[0], case_53[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("53b", boost::make_tuple(4, 0.0, 0.0), case_53[0], case_53[2]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("54aa", boost::make_tuple(13, 0.0, 0.0), case_54[0], case_54[2]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("54ab", boost::make_tuple(13, 0.0, 0.0), case_54[0], case_54[3]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("54ba", boost::make_tuple(13, 0.0, 0.0), case_54[1], case_54[2]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("54bb", boost::make_tuple(13, 0.0, 0.0), case_54[1], case_54[3]);
+
+ // other
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("many_situations", boost::make_tuple(31, 11.625, 13.875), case_many_situations[0], case_many_situations[1]);
+
+
+ // ticket#17
+ test_overlay<polygon, box, test_get_turns, Tuple>("ticket_17", boost::make_tuple(6, -122.27866617838542, 37.377897262573242), ticket_17[0], ticket_17[1]);
+
+
+
+ // pies
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("pie_23_16_16", boost::make_tuple(3, 0.0, 0.0), pie_23_16_16[0], pie_23_16_16[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("pie_16_4_12", boost::make_tuple(2, 0.0, 0.0), pie_16_4_12[0], pie_16_4_12[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("pie_4_13_15", boost::make_tuple(3, 0.0, 0.0), pie_4_13_15[0], pie_4_13_15[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("pie_16_2_15_0", boost::make_tuple(2, 0.0, 0.0), pie_16_2_15_0[0], pie_16_2_15_0[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("pie_20_20_7_100", boost::make_tuple(3, 0.0, 0.0), pie_20_20_7_100[0], pie_20_20_7_100[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("pie_23_23_3_2000", boost::make_tuple(5, 0.0, 0.0), pie_23_23_3_2000[0], pie_23_23_3_2000[1]);
+
+
+ // line-line
+ test_overlay<linestring, linestring, test_get_turns, Tuple>("lineline1", boost::make_tuple(3, 1.6190476, 3.4761905), line_line1[0], line_line1[1]);
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<float>();
+ test_all<double>();
+ //test_all<tt>();
+
+#if ! defined(_MSC_VER)
+ test_all<long double>();
+#endif
+#if defined(HAVE_CLN)
+ //test_all<boost::numeric_adaptor::cln_value_type>();
+#endif
+#if defined(HAVE_GMP)
+ //test_all<boost::numeric_adaptor::gmp_value_type>();
+#endif
+ return 0;
+}
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="get_turns"
+ ProjectGUID="{B63116BF-0F0C-4374-A6CE-77061FBC34FF}"
+ RootNamespace="get_turns"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\get_turns"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\get_turns"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\get_turns.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/merge_intersection_points.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/merge_intersection_points.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1 @@
+// obsolete
\ No newline at end of file

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/merge_intersection_points.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/merge_intersection_points.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="merge_intersection_points"
+ ProjectGUID="{EB8223BB-6989-4AC8-A72E-4E076FE04547}"
+ RootNamespace="merge_intersection_points"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\merge_intersection_points"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\merge_intersection_points"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\merge_intersection_points.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,55 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "enrich_intersection_points", "enrich_intersection_points.vcproj", "{20FE798A-E4EE-4C87-A988-7317E774D28A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "traverse", "traverse.vcproj", "{6260214E-DB6F-4934-ADF7-DD2B1666171B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "self_intersection_points", "self_intersection_points.vcproj", "{06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_turn_info", "get_turn_info.vcproj", "{8D98821A-5033-4616-9AF4-2AEAA42D8456}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_turns", "get_turns.vcproj", "{B63116BF-0F0C-4374-A6CE-77061FBC34FF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "relative_order", "relative_order.vcproj", "{4C012342-116A-4E5E-9869-90389D5BBEBD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assemble", "assemble.vcproj", "{306E829F-ACEC-42D5-B1D4-2531B2F56EA3}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {20FE798A-E4EE-4C87-A988-7317E774D28A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {20FE798A-E4EE-4C87-A988-7317E774D28A}.Debug|Win32.Build.0 = Debug|Win32
+ {20FE798A-E4EE-4C87-A988-7317E774D28A}.Release|Win32.ActiveCfg = Release|Win32
+ {20FE798A-E4EE-4C87-A988-7317E774D28A}.Release|Win32.Build.0 = Release|Win32
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.Build.0 = Debug|Win32
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.ActiveCfg = Release|Win32
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.Build.0 = Release|Win32
+ {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Debug|Win32.Build.0 = Debug|Win32
+ {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Release|Win32.ActiveCfg = Release|Win32
+ {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Release|Win32.Build.0 = Release|Win32
+ {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Debug|Win32.Build.0 = Debug|Win32
+ {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Release|Win32.ActiveCfg = Release|Win32
+ {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Release|Win32.Build.0 = Release|Win32
+ {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Debug|Win32.Build.0 = Debug|Win32
+ {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Release|Win32.ActiveCfg = Release|Win32
+ {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Release|Win32.Build.0 = Release|Win32
+ {4C012342-116A-4E5E-9869-90389D5BBEBD}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4C012342-116A-4E5E-9869-90389D5BBEBD}.Debug|Win32.Build.0 = Debug|Win32
+ {4C012342-116A-4E5E-9869-90389D5BBEBD}.Release|Win32.ActiveCfg = Release|Win32
+ {4C012342-116A-4E5E-9869-90389D5BBEBD}.Release|Win32.Build.0 = Release|Win32
+ {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Debug|Win32.Build.0 = Debug|Win32
+ {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Release|Win32.ActiveCfg = Release|Win32
+ {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,322 @@
+#ifndef BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP
+#define BOOST_GEOMETRY_TEST_OVERLAY_CASES_HPP
+
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <string>
+
+// See powerpoint
+
+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 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_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_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_9[2] = {
+ "POLYGON((0 0,0 4,4 0,0 0))",
+ "POLYGON((2 2,2 4,5 4,2 2))" };
+
+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_11[2] = {
+ "POLYGON((0 0,0 4,4 0,0 0))",
+ "POLYGON((1 2,2 2,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_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_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_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_17[2] = {
+ "POLYGON((0 0,0 4,4 0,0 0))",
+ "POLYGON((1 1,1 3,3 1,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_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))" };
+
+// 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))",
+ // a: 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))",
+ // b: 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] = {
+ // a: 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))",
+ // b: 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))",
+ case_53[1],
+ case_53[2]
+ // other like in case53
+ };
+
+static std::string case_55[2] = {
+ "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))",
+ "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))"
+ };
+
+
+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 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))"
+ };
+
+
+// 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))"
+ };
+
+
+
+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.37
165986,-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,-1
22.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.332981
57 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.457
96329,-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,-12
2.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 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.06988934
4709196 -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))"
+ };
+*/
+
+#endif // GGL_TEST_OVERLAY_CASES_HPP

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_common.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_common.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,456 @@
+#ifndef BOOST_GEOMETRY_TEST_OVERLAY_COMMON_HPP
+#define BOOST_GEOMETRY_TEST_OVERLAY_COMMON_HPP
+
+
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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)
+// We deliberately mix float/double's here so turn off warning
+#pragma warning( disable : 4244 )
+
+#endif // defined(_MSC_VER)
+
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+
+
+template <typename G1, typename G2, typename Functor, typename T>
+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;
+ boost::geometry::read_wkt(wkt1, g1);
+
+ G2 g2;
+ boost::geometry::read_wkt(wkt2, g2);
+
+
+ // Try the overlay-function in both ways
+ std::string caseid = id + "_1";
+//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_REVERSED)
+ caseid = id + "_2";
+#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 <typename P, typename Functor, typename T>
+void test_all(std::vector<T> const& expected)
+{
+ typedef boost::geometry::polygon<P> polygon;
+ typedef boost::geometry::linestring<P> linestring;
+ typedef boost::geometry::box<P> box;
+
+ // compilation test only, will not output
+ //test_overlay<box, polygon, Functor>("", "", "", "");
+ typename boost::range_const_iterator<std::vector<T> >::type iterator
+ = boost::begin(expected);
+
+
+#ifndef ONLY_CASE_BRANDON
+
+ BOOST_ASSERT(iterator != boost::end(expected));
+ test_overlay<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, box, Functor>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, box, Functor>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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<polygon, polygon, Functor, T>("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.332
44019 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<polygon, polygon, Functor, T>("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<polygon, box, Functor>("44b", *iterator, ticket17, "BOX(-122.297 37.368,-122.242 37.413)");
+ test_overlay<polygon, box, Functor>("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.4880
97190856934,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<polygon, polygon, Functor>("isovist", *iterator, p5, p6);
+ }
+ iterator++;
+
+
+ return;
+
+
+#if ! defined(NO_LINESTRING_INTERSECTION)
+ BOOST_ASSERT(iterator != boost::end(expected));
+ test_overlay<linestring, linestring, Functor, T>("100", *iterator,
+ "LINESTRING(0 1,2 5,5 3)",
+ "LINESTRING(3 0,0 3,4 5)");
+#endif
+
+
+
+/*
+
+ test_overlay<box, polygon, Functor>(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<box, polygon, Functor>(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<box, polygon, Functor>(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<box, polygon, Functor>(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<box, polygon, Functor>(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<box, polygon, Functor>(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<box, polygon, Functor>(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<box, polygon, Functor>(16, "box(0 0, 3 3)",
+ "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))");
+
+ test_overlay<box, polygon, Functor>(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

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,204 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <iostream>
+
+#include <ggl_test_common.hpp>
+
+
+#include <boost/foreach.hpp>
+
+#include <boost/geometry/algorithms/intersection.hpp>
+
+#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/get_relative_order.hpp>
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+
+template <typename P, typename T>
+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)
+{
+ namespace bg = boost::geometry;
+ P pi = bg::make<P>(pi_x, pi_y);
+ P pj = bg::make<P>(pj_x, pj_y);
+ P ri = bg::make<P>(ri_x, ri_y);
+ P rj = bg::make<P>(rj_x, rj_y);
+ P si = bg::make<P>(si_x, si_y);
+ P sj = bg::make<P>(sj_x, sj_y);
+
+ int order = bg::detail::overlay::get_relative_order<P>::apply(pi, pj, ri, rj, si, sj);
+
+ 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<typename boost::geometry::coordinate_type<P>::type>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<P> mapper(svg, 500, 500);
+ mapper.add(bg::make<P>(0, 0));
+ mapper.add(bg::make<P>(10, 10));
+
+ bg::linestring<P> p; p.push_back(pi); p.push_back(pj); p.push_back(pk);
+ bg::linestring<P> 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 <typename P>
+void test_all()
+{
+ test_with_point<P, double>("OLR1",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 3, 3, 7, 2, // s
+ 1);
+ test_with_point<P, double>("OLR2",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 3, 7, 7, 6, // s
+ -1);
+ test_with_point<P, double>("OLR3",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 4, 2, 9, 6, // s
+ 1);
+ test_with_point<P, double>("OLR4",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 3, 8, 9, 4, // s
+ -1);
+ test_with_point<P, double>("OLR5",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 4, 2, 8, 6, // s
+ 1);
+ test_with_point<P, double>("OLR6",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 3, 7, 9, 4, // s
+ -1);
+ test_with_point<P, double>("OLR7",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 1, 4, 7, 7, // s
+ -1);
+ test_with_point<P, double>("OLR8",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 1, 6, 7, 3, // s
+ 1);
+
+
+ test_with_point<P, double>("OD1",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 7, 2, 3, 3, // s
+ 1);
+
+ test_with_point<P, double>("OD9",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 7, 5, 3, 3, // s
+ 1);
+ test_with_point<P, double>("OD10",
+ 5, 1, 5, 8, // p
+ 3, 5, 7, 5, // r
+ 7, 5, 3, 7, // s
+ -1);
+ test_with_point<P, double>("OD11",
+ 5, 1, 5, 8, // p
+ 7, 5, 3, 5, // r
+ 3, 5, 7, 7, // s
+ -1);
+ test_with_point<P, double>("OD12",
+ 5, 1, 5, 8, // p
+ 7, 5, 3, 5, // r
+ 3, 5, 7, 3, // s
+ 1);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<double> >();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/relative_order.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="relative_order"
+ ProjectGUID="{4C012342-116A-4E5E-9869-90389D5BBEBD}"
+ RootNamespace="relative_order"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\relative_order"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\relative_order"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\relative_order.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_pies.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_pies.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,142 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2009, 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 <iostream>
+#include <string>
+
+#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR
+#define BOOST_GEOMETRY_NO_BOOST_TEST
+
+#include <boost/timer.hpp>
+#include <boost/lexical_cast.hpp>
+
+
+#include <boost/geometry/geometry.hpp>
+
+#include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#include <ggl_test_common.hpp>
+#include <test_overlay_p_q.hpp>
+
+
+
+template <typename Polygon>
+inline void make_pie(Polygon& polygon,
+ int count, int offset, int offset_y, double factor1, int total_segment_count = 36)
+{
+ typedef typename boost::geometry::point_type<Polygon>::type p;
+ typedef typename boost::geometry::select_most_precise
+ <
+ typename boost::geometry::coordinate_type<Polygon>::type,
+ long double
+ >::type coordinate_type;
+
+ // Create pie
+ coordinate_type cx = 2500.0;
+ coordinate_type cy = 2500.0 + offset_y;
+
+ boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make<p>(int(cx), int(cy)));
+
+ coordinate_type dx = 5000.0;
+ coordinate_type dy = 5000.0;
+
+ coordinate_type half = 0.5;
+ coordinate_type two = 2.0;
+
+ coordinate_type a = coordinate_type(factor1) * half * dx;
+ coordinate_type b = coordinate_type(factor1) * half * dy;
+
+ coordinate_type pi = boost::math::constants::pi<long double>();
+ coordinate_type delta = pi * two / total_segment_count;
+ coordinate_type angle = coordinate_type(offset) * delta;
+ for (int i = 0; i < count; i++, angle += delta)
+ {
+ coordinate_type s = sin(angle);
+ coordinate_type c = cos(angle);
+ coordinate_type x = cx + a * s;
+ coordinate_type y = cy + b * c;
+ boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make<p>(int(x), int(y)));
+ }
+ boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make<p>(int(cx), int(cy)));
+}
+
+
+template <typename T>
+void test_pie(int total_segment_count, T factor_p, T factor_q)
+{
+ boost::timer t;
+ typedef boost::geometry::point_xy<T> point_type;
+ typedef boost::geometry::polygon<point_type> 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);
+ 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)
+ {
+ polygon q;
+ make_pie(q, b, offset, y, factor_q, total_segment_count);
+
+ std::ostringstream out;
+ out << "pie_" << a << "_" << b << "_" << offset << "_" << y;
+
+ if (test_overlay_p_q<polygon, T>(out.str(), p, q, false, 0.01))
+ {
+ good_count++;
+ }
+ else
+ {
+ bad_count++;
+ }
+ }
+ }
+ }
+ }
+ std::cout
+ << "Time: " << t.elapsed() << std::endl
+ << "Good: " << good_count << std::endl
+ << "Bad: " << bad_count << std::endl;
+}
+
+
+template <typename T>
+void test_all()
+{
+ test_pie<T>(24, 0.55, 0.45);
+}
+
+int main(int argc, char** argv)
+{
+ try
+ {
+ //test_all<float>();
+ test_all<double>();
+ //test_all<long double>();
+
+#if defined(HAVE_CLN)
+ //test_all<boost::numeric_adaptor::cln_value_type>();
+#endif
+#if defined(HAVE_GMP)
+ //test_all<boost::numeric_adaptor::gmp_value_type>();
+#endif
+ }
+ catch(std::exception const& e)
+ {
+ std::cout << "Exception " << e.what() << std::endl;
+ }
+ catch(...)
+ {
+ std::cout << "Other exception" << std::endl;
+ }
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_pies.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_pies.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="intersection_pies"
+ ProjectGUID="{24D92478-7C66-4DD5-A501-30A3D4376E4F}"
+ RootNamespace="intersection_pies"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersection_pies"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;c:\gmp\gmp-dynamic&quot;;c:\svn\numeric_adaptor;.;../../../../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="gmp.lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="&quot;C:\gmp\gmp-dynamic&quot;"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersection_pies"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;c:\gmp\gmp-dynamic&quot;;c:\svn\numeric_adaptor;.;../../../../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="gmp.lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="&quot;C:\gmp\gmp-dynamic&quot;"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\intersection_pies.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_stars.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_stars.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,178 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2009, 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 <iostream>
+#include <string>
+
+#define BOOST_GEOMETRY_NO_BOOST_TEST
+
+#include <algorithms/test_intersection.hpp>
+#include <algorithms/test_overlay.hpp>
+
+#include <boost/timer.hpp>
+#include <boost/lexical_cast.hpp>
+
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <test_common/test_point.hpp>
+#include <test_common/with_pointer.hpp>
+
+// Two at the same time not (yet) supported
+#if defined(HAVE_CLN) && defined(HAVE_GMP)
+#undef HAVE_GMP
+#endif
+
+
+
+template <typename Polygon>
+inline void make_star(Polygon& polygon,
+ int count, double factor1, double factor2, long double offset = 0)
+{
+ typedef typename boost::geometry::point_type<Polygon>::type p;
+ typedef typename boost::geometry::select_most_precise
+ <
+ typename boost::geometry::coordinate_type<Polygon>::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<long double>();
+ coordinate_type delta = pi * two / coordinate_type(count - 1);
+ coordinate_type angle = coordinate_type(offset) * delta;
+ std::cout << "Start with angle: " << angle << std::endl;
+ 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;
+ boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make<p>(x, y));
+
+ }
+ boost::geometry::exterior_ring(polygon).push_back(boost::geometry::exterior_ring(polygon).front());
+}
+
+
+template <typename T, typename CalculationType>
+void test_star(std::string const& p_type, std::string const& c_type,
+ std::string const& p_selection, std::string const& c_selection,
+ int min_points, int max_points, T rotation)
+{
+ if ((! p_selection.empty() && p_selection != p_type)
+ || (! c_selection.empty() && c_selection != c_type))
+ {
+ return;
+ }
+
+ std::cout << "TESTING case "
+ << p_type << " (" << sizeof(T) << ") "
+ << c_type << " (" << sizeof(CalculationType) << ")"
+ << std::endl;
+ boost::timer t;
+ typedef boost::geometry::point_xy<T> point_type;
+ typedef boost::geometry::polygon<point_type> polygon;
+
+ T area_i = 0;
+ T area_a = 0;
+ T area_b = 0;
+ //T area_u = 0;
+
+ for (int p = min_points; p <= max_points; p++)
+ {
+ std::ostringstream out;
+ out << "_" << p_type << "_" << c_type << "_" << p << "_int";
+
+ polygon a;
+ make_star(a, p * 2 + 1, 0.5, 1.0);
+ polygon b;
+ make_star(b, p * 2 + 1, 0.5, 1.0, rotation);
+
+ area_i += test_intersection<polygon, CalculationType>(out.str(), a, b);
+ area_a += boost::geometry::area(a);
+ area_b += boost::geometry::area(b);
+ }
+
+ std::cout
+ << " time: " << t.elapsed() << std::endl
+ << " area: " << area_i << std::endl
+ << " area a: " << area_a << std::endl
+ << " area b: " << area_b << std::endl
+ << " diff: " << (area_i - area_a) << std::endl
+ ;
+}
+
+template <typename T>
+void test_all(std::string const& p_type,
+ std::string const& p_selection,
+ std::string const& c_selection,
+ int min_points, int max_points, long double rotation)
+{
+ test_star<T, float>(p_type, "f", p_selection, c_selection,
+ min_points, max_points, rotation);
+ test_star<T, double>(p_type, "d", p_selection, c_selection,
+ min_points, max_points, rotation);
+ test_star<T, long double>(p_type, "e", p_selection, c_selection,
+ min_points, max_points, rotation);
+
+#if defined(HAVE_CLN)
+ test_star<T, boost::numeric_adaptor::cln_value_type>(p_type, "c",
+ p_selection, c_selection, min_points, max_points, rotation);
+#endif
+#if defined(HAVE_GMP)
+ test_star<T, boost::numeric_adaptor::gmp_value_type>(p_type, "g",
+ p_selection, c_selection, min_points, max_points, rotation);
+#endif
+}
+
+int main(int argc, char** argv)
+{
+ try
+ {
+ std::string p_selection = argc > 1 ? argv[1] : "";
+ std::string c_selection = argc > 2 ? argv[2] : "";
+ int min_points = argc > 3 ? boost::lexical_cast<int>(argv[3]) : 9;
+ int max_points = argc > 4 ? boost::lexical_cast<int>(argv[4]) : min_points;
+ long double rotation = argc > 5 ? boost::lexical_cast<long double>(argv[5]) : 1e-15;
+
+ test_all<float>("f", p_selection, c_selection, min_points, max_points, rotation);
+ test_all<double>("d", p_selection, c_selection, min_points, max_points, rotation);
+ test_all<long double>("e", p_selection, c_selection, min_points, max_points, rotation);
+
+#if defined(HAVE_CLN)
+ test_all<boost::numeric_adaptor::cln_value_type>("c",
+ p_selection, c_selection, min_points, max_points, rotation);
+#endif
+#if defined(HAVE_GMP)
+ test_all<boost::numeric_adaptor::gmp_value_type>("g",
+ p_selection, c_selection, min_points, max_points, rotation);
+#endif
+ }
+ catch(std::exception const& e)
+ {
+ std::cout << "Exception " << e.what() << std::endl;
+ }
+ catch(...)
+ {
+ std::cout << "Other exception" << std::endl;
+ }
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_stars.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/intersection_stars.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="intersection_stars"
+ ProjectGUID="{A76B81BF-B5B4-4D09-BB81-F235647891DE}"
+ RootNamespace="intersection_stars"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersection_stars"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;c:\gmp\gmp-dynamic&quot;;c:\svn\numeric_adaptor;../../../../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;TEST_WITH_SVG;HAVE_GMP;BOOST_GEOMETRY_DEBUG_INTERSECTION"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="gmp.lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="&quot;C:\gmp\gmp-dynamic&quot;"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\intersection_stars"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;c:\gmp\gmp-dynamic&quot;;c:\svn\numeric_adaptor;../../../../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="gmp.lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="&quot;C:\gmp\gmp-dynamic&quot;"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\intersection_stars.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,301 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2009, 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 <iostream>
+#include <sstream>
+#include <fstream>
+#include <iomanip>
+#include <string>
+
+#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR
+#define BOOST_GEOMETRY_NO_BOOST_TEST
+
+#include <boost/timer.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/random/linear_congruential.hpp>
+#include <boost/random/uniform_int.hpp>
+#include <boost/random/uniform_real.hpp>
+#include <boost/random/variate_generator.hpp>
+
+
+
+#include <boost/geometry/geometry.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#include <ggl_test_common.hpp>
+#include <test_overlay_p_q.hpp>
+
+
+/*
+template <typename OutputType, typename CalculationType, typename G1, typename G2>
+void test_overlay(int seed, int caseid, G1 const& a, G2 const& b, bool svg, double tolerance)
+{
+ typedef typename boost::geometry::coordinate_type<G1>::type coordinate_type;
+ typedef typename boost::geometry::point_type<G1>::type point_type;
+ typedef boost::geometry::detail::intersection::intersection_point<point_type> ip_type;
+
+ typedef boost::geometry::strategy_intersection
+ <
+ typename boost::geometry::cs_tag<point_type>::type,
+ G1,
+ G2,
+ ip_type,
+ CalculationType
+ > strategy;
+
+ std::vector<OutputType> out_i, out_u;
+
+
+ CalculationType area_a = boost::geometry::area(a);
+ CalculationType area_b = boost::geometry::area(b);
+
+ CalculationType area_i = 0;
+ CalculationType area_u = 0;
+
+ boost::geometry::intersection_inserter<OutputType>(a, b, std::back_inserter(out_i), strategy());
+ for (typename std::vector<OutputType>::iterator it = out_i.begin();
+ it != out_i.end();
+ ++it)
+ {
+ area_i += boost::geometry::area(*it);
+ }
+ boost::geometry::union_inserter<OutputType>(a, b, std::back_inserter(out_u), strategy());
+ for (typename std::vector<OutputType>::iterator it = out_u.begin();
+ it != out_u.end();
+ ++it)
+ {
+ area_u += boost::geometry::area(*it);
+ }
+
+ double diff = (area_a + area_b) - area_u - area_i;
+ if (std::abs(diff) > tolerance)
+ {
+ svg = true;
+ std::cout
+ << "type: " << string_from_type<CalculationType>::name()
+ << " id: " << caseid
+ << " seed: " << seed
+ << " area i: " << area_i
+ << " area u: " << area_u
+ << " area a: " << area_a
+ << " area b: " << area_b
+ << " diff: " << diff
+ << std::endl
+ << std::setprecision(20)
+ << " a: " << boost::geometry::wkt(a) << std::endl
+ << " b: " << boost::geometry::wkt(b) << std::endl
+ ;
+ }
+
+ if(svg)
+ {
+ std::ostringstream filename;
+ filename << "overlay_random_ellipse_stars_" << caseid << "_"
+ << string_from_type<coordinate_type>::name()
+ << string_from_type<CalculationType>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<point_type> mapper(svg, 500, 500);
+
+ mapper.add(a);
+ mapper.add(b);
+
+ mapper.map(a, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1");
+ mapper.map(b, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1");
+
+ for (typename std::vector<OutputType>::const_iterator it = out_i.begin();
+ it != out_i.end(); ++it)
+ {
+ mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:3");
+ }
+ for (typename std::vector<OutputType>::const_iterator it = out_u.begin();
+ it != out_u.end(); ++it)
+ {
+ mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,255);stroke-width:3");
+ }
+ }
+}
+*/
+
+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 <typename Polygon>
+inline void make_star(Polygon& polygon, star_params const& p)
+{
+ typedef typename boost::geometry::point_type<Polygon>::type P;
+ typedef typename boost::geometry::select_most_precise
+ <
+ typename boost::geometry::coordinate_type<Polygon>::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<long double>();
+ 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;
+ boost::geometry::exterior_ring(polygon).push_back(boost::geometry::make<P>(x, y));
+
+ }
+ boost::geometry::exterior_ring(polygon).push_back(boost::geometry::exterior_ring(polygon).front());
+}
+
+
+template <typename T>
+void test_star_ellipse(int seed, int index, star_params const& par_p,
+ star_params const& par_q, bool svg, double tolerance)
+{
+ typedef boost::geometry::point_xy<T> point_type;
+ typedef boost::geometry::polygon<point_type> 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<polygon, T>(out.str(), p, q, svg, tolerance);
+}
+
+template <typename T>
+void test_all(int seed, int count, bool svg, double tolerance)
+{
+ 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<base_generator_type&, boost::uniform_real<> >
+ factor_generator(generator, random_factor);
+
+ boost::variate_generator<base_generator_type&, boost::uniform_real<> >
+ location_generator(generator, random_location);
+
+ boost::variate_generator<base_generator_type&, boost::uniform_real<> >
+ rotation_generator(generator, random_rotation);
+
+ boost::variate_generator<base_generator_type&, boost::uniform_int<> >
+ int_generator(generator, random_points);
+
+ for(int i = 0; i < count; i++)
+ {
+ test_star_ellipse<T>(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()),
+ svg, tolerance);
+ }
+ std::cout
+ << "type: " << string_from_type<T>::name()
+ << " time: " << t.elapsed() << std::endl;
+}
+
+int main(int argc, char** argv)
+{
+ try
+ {
+ int count = argc > 1 ? boost::lexical_cast<int>(argv[1]) : 10;
+ int seed = (argc > 2 && std::string(argv[2]) != std::string("#"))
+ ? boost::lexical_cast<int>(argv[2])
+ : static_cast<unsigned int>(std::time(0));
+ bool svg = argc > 3 && std::string(argv[3]) == std::string("svg");
+
+ test_all<float>(seed, count, svg, 1e-3);
+ //test_all<double>(seed, count, svg, 1e-6);
+
+#if defined(HAVE_CLN)
+ //test_star_ellipse<boost::numeric_adaptor::cln_value_type>("c",
+#endif
+#if defined(HAVE_GMP)
+ // test_star_ellipse<boost::numeric_adaptor::gmp_value_type>(selection, "g");
+#endif
+ }
+ catch(std::exception const& e)
+ {
+ std::cout << "Exception " << e.what() << std::endl;
+ }
+ catch(...)
+ {
+ std::cout << "Other exception" << std::endl;
+ }
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/random_ellipses_stars.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="random_ellipses_stars"
+ ProjectGUID="{C16633DE-83F8-40E3-9915-3B9C872C7B1E}"
+ RootNamespace="random_ellipses_stars"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\random_ellipses_stars"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../..;../../..;."
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="2"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\random_ellipses_stars"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../..;../../..;."
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\random_ellipses_stars.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,162 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2009, 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 <iostream>
+#include <sstream>
+#include <fstream>
+#include <iomanip>
+#include <string>
+
+#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR
+#define BOOST_GEOMETRY_NO_BOOST_TEST
+
+#include <boost/timer.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/random/linear_congruential.hpp>
+#include <boost/random/uniform_int.hpp>
+#include <boost/random/uniform_real.hpp>
+#include <boost/random/variate_generator.hpp>
+
+
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/multi/multi.hpp>
+#include <boost/geometry/multi/algorithms/overlay/assemble.hpp>
+
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#include <ggl_test_common.hpp>
+#include <test_overlay_p_q.hpp>
+
+template <typename Polygon, typename Generator>
+inline void make_box(Polygon& polygon, Generator& generator)
+{
+ namespace bg = boost::geometry;
+ typedef typename bg::point_type<Polygon>::type point_type;
+ typedef typename bg::coordinate_type<Polygon>::type coordinate_type;
+
+ coordinate_type x, y;
+ x = generator();
+ y = generator();
+
+ typename bg::ring_type<Polygon>::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);
+}
+
+
+
+template <typename MultiPolygon, typename Generator>
+void test_recursive_boxes(MultiPolygon& result, int& index,
+ Generator& generator, bool svg, int level = 3)
+{
+ namespace bg = boost::geometry;
+ MultiPolygon p, q;
+
+ // Generate two boxes
+ if (level == 0)
+ {
+ p.resize(1);
+ q.resize(1);
+ make_box(p.front(), generator);
+ make_box(q.front(), generator);
+ }
+ else
+ {
+ test_recursive_boxes(p, index, generator, svg, level - 1);
+ test_recursive_boxes(q, index, generator, svg, level - 1);
+ }
+
+ typedef typename boost::range_value<MultiPolygon>::type polygon;
+
+ std::ostringstream out;
+ out << "recursive_box_" << index++ << "_" << level;
+ test_overlay_p_q
+ <
+ polygon,
+ typename bg::coordinate_type<MultiPolygon>::type
+ >(out.str(), p, q, svg, 0.001);
+
+ MultiPolygon mp;
+ bg::union_inserter
+ <
+ polygon
+ >(p, q, std::back_inserter(mp));
+
+ result = mp;
+}
+
+template <typename T>
+void test_all(int seed, int count, bool svg)
+{
+ boost::timer t;
+
+ typedef boost::minstd_rand base_generator_type;
+
+ boost::uniform_int<> random_coordinate(0, 9);
+ base_generator_type generator(seed);
+ boost::variate_generator<base_generator_type&, boost::uniform_int<> >
+ int_generator(generator, random_coordinate);
+
+ typedef boost::geometry::polygon
+ <
+ boost::geometry::point_xy<T>
+ > polygon;
+ typedef boost::geometry::multi_polygon<polygon> mp;
+
+
+ int index = 0;
+ for(int i = 0; i < count; i++)
+ {
+
+ mp p;
+ test_recursive_boxes<mp>(p, index, int_generator, svg);
+ }
+ std::cout
+ << "type: " << string_from_type<T>::name()
+ << " time: " << t.elapsed() << std::endl;
+}
+
+int main(int argc, char** argv)
+{
+ try
+ {
+ int count = argc > 1 ? boost::lexical_cast<int>(argv[1]) : 10;
+ int seed = (argc > 2 && std::string(argv[2]) != std::string("#"))
+ ? boost::lexical_cast<int>(argv[2])
+ : static_cast<unsigned int>(std::time(0));
+ bool svg = argc > 3 && std::string(argv[3]) == std::string("svg");
+
+ //test_all<float>(seed, count, svg, 1e-3);
+ test_all<double>(seed, count, svg);
+
+#if defined(HAVE_CLN)
+ //test_recursive_boxes<boost::numeric_adaptor::cln_value_type>("c",
+#endif
+#if defined(HAVE_GMP)
+ // test_recursive_boxes<boost::numeric_adaptor::gmp_value_type>(selection, "g");
+#endif
+ }
+ catch(std::exception const& e)
+ {
+ std::cout << "Exception " << e.what() << std::endl;
+ }
+ catch(...)
+ {
+ std::cout << "Other exception" << std::endl;
+ }
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/recursive_boxes.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="recursive_boxes"
+ ProjectGUID="{E1AA569C-858C-4789-A6FF-5CDFB41C59D7}"
+ RootNamespace="recursive_boxes"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\recursive_boxes"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../..;../../..;."
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="2"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\recursive_boxes"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="0"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../..;../../..;."
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="0"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\recursive_boxes.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/robustness.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/robustness.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "random_ellipses_stars", "random_ellipses_stars.vcproj", "{C16633DE-83F8-40E3-9915-3B9C872C7B1E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersection_stars", "intersection_stars.vcproj", "{A76B81BF-B5B4-4D09-BB81-F235647891DE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersection_pies", "intersection_pies.vcproj", "{24D92478-7C66-4DD5-A501-30A3D4376E4F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recursive_boxes", "recursive_boxes.vcproj", "{E1AA569C-858C-4789-A6FF-5CDFB41C59D7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Debug|Win32.Build.0 = Debug|Win32
+ {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Release|Win32.ActiveCfg = Release|Win32
+ {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Release|Win32.Build.0 = Release|Win32
+ {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Debug|Win32.Build.0 = Debug|Win32
+ {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Release|Win32.ActiveCfg = Release|Win32
+ {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Release|Win32.Build.0 = Release|Win32
+ {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Debug|Win32.Build.0 = Debug|Win32
+ {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Release|Win32.ActiveCfg = Release|Win32
+ {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Release|Win32.Build.0 = Release|Win32
+ {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Debug|Win32.Build.0 = Debug|Win32
+ {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Release|Win32.ActiveCfg = Release|Win32
+ {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/test_overlay_p_q.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/robustness/test_overlay_p_q.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,118 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2009, 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_OVERLAY_P_Q_HPP
+#define BOOST_GEOMETRY_TEST_OVERLAY_P_Q_HPP
+
+#include <fstream>
+#include <iomanip>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <ggl_test_common.hpp>
+
+
+template <typename OutputType, typename CalculationType, typename G1, typename G2>
+static bool test_overlay_p_q(std::string const& caseid, G1 const& p, G2 const& q, bool svg, double tolerance)
+{
+ bool result = true;
+
+ typedef typename boost::geometry::coordinate_type<G1>::type coordinate_type;
+ typedef typename boost::geometry::point_type<G1>::type point_type;
+ typedef boost::geometry::detail::intersection::intersection_point<point_type> ip_type;
+
+ typedef boost::geometry::strategy_intersection
+ <
+ typename boost::geometry::cs_tag<point_type>::type,
+ G1,
+ G2,
+ ip_type,
+ CalculationType
+ > strategy;
+
+ std::vector<OutputType> out_i, out_u;
+
+ CalculationType area_p = boost::geometry::area(p);
+ CalculationType area_q = boost::geometry::area(q);
+
+ CalculationType area_i = 0;
+ CalculationType area_u = 0;
+
+ boost::geometry::intersection_inserter<OutputType>(p, q, std::back_inserter(out_i), strategy());
+ for (typename std::vector<OutputType>::iterator it = out_i.begin();
+ it != out_i.end();
+ ++it)
+ {
+ area_i += boost::geometry::area(*it);
+ }
+ boost::geometry::union_inserter<OutputType>(p, q, std::back_inserter(out_u), strategy());
+ for (typename std::vector<OutputType>::iterator it = out_u.begin();
+ it != out_u.end();
+ ++it)
+ {
+ area_u += boost::geometry::area(*it);
+ }
+
+ double diff = (area_p + area_q) - area_u - area_i;
+ if (std::abs(diff) > tolerance
+ // for creating SVG-selection: || area_i > 2.0e+006
+ )
+ {
+ result = false;
+ svg = true;
+
+ std::cout
+ << "type: " << string_from_type<CalculationType>::name()
+ << " id: " << caseid
+ << " area i: " << area_i
+ << " area u: " << area_u
+ << " area p: " << area_p
+ << " area q: " << area_q
+ << " diff: " << diff
+ << std::endl
+ << std::setprecision(20)
+ << " p: " << boost::geometry::wkt(p) << std::endl
+ << " q: " << boost::geometry::wkt(q) << std::endl
+ ;
+
+ }
+
+
+ if(svg)
+ {
+ std::ostringstream filename;
+ filename << "overlay_" << caseid << "_"
+ << string_from_type<coordinate_type>::name()
+ << string_from_type<CalculationType>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<point_type> mapper(svg, 500, 500);
+
+ mapper.add(p);
+ mapper.add(q);
+
+ mapper.map(p, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1");
+ mapper.map(q, "opacity:0.6;fill:rgb(0,0,255);stroke:rgb(0,0,0);stroke-width:1");
+
+ for (typename std::vector<OutputType>::const_iterator it = out_i.begin();
+ it != out_i.end(); ++it)
+ {
+ mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:3");
+ }
+ for (typename std::vector<OutputType>::const_iterator it = out_u.begin();
+ it != out_u.end(); ++it)
+ {
+ mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,255);stroke-width:3");
+ }
+ }
+ return result;
+}
+
+#endif // BOOST_GEOMETRY_TEST_OVERLAY_P_Q_HPP

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,234 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <iomanip>
+#include <string>
+
+#include <ggl_test_common.hpp>
+
+
+#include <boost/geometry/algorithms/intersection.hpp>
+#include <boost/geometry/algorithms/intersects.hpp>
+//#include <boost/geometry/algorithms/overlay/self_intersection_points.hpp>
+#include <boost/geometry/algorithms/overlay/self_turn_points.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+
+struct test_self_intersection_points
+{
+ template <typename Geometry>
+ static void apply(std::string const& id,
+ boost::tuple<int, double, double> const& expected_count_and_center,
+ Geometry const& geometry, double precision)
+ {
+ namespace bg = boost::geometry;
+ typedef bg::detail::overlay::turn_info
+ <
+ typename bg::point_type<Geometry>::type
+ > turn_info;
+
+ std::vector<turn_info> turns;
+
+ ///boost::geometry::get_intersection_points(geometry, turns);
+
+ bg::detail::get_turns::no_interrupt_policy policy;
+ boost::geometry::get_turns
+ <
+ bg::detail::overlay::assign_null_policy
+ >(geometry, turns, policy);
+
+
+ double x = 0, y = 0;
+ BOOST_FOREACH(turn_info const& turn, turns)
+ {
+ x += boost::geometry::get<0>(turn.point);
+ y += boost::geometry::get<1>(turn.point);
+ }
+ int n = boost::size(turns);
+ if (n > 0)
+ {
+ x /= n;
+ y /= n;
+ }
+ /*std::cout << std::setprecision(8) << x << ", " << y << " "
+ << expected_count_and_center.get<1>()
+ << " " << expected_count_and_center.get<2>()
+ << std::endl;
+ */
+
+ BOOST_CHECK_EQUAL(expected_count_and_center.get<0>(), n);
+ BOOST_CHECK_CLOSE(expected_count_and_center.get<1>(), x, precision);
+ BOOST_CHECK_CLOSE(expected_count_and_center.get<2>(), y, precision);
+
+ if (n > 0)
+ {
+ BOOST_CHECK_EQUAL(boost::geometry::intersects(geometry), true);
+ }
+
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "self_ip" << id << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<typename boost::geometry::point_type<Geometry>::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 <typename Geometry, typename T>
+void test_self_overlay(std::string const& id, T const& expected,
+ std::string const& wkt, double precision = 0.001)
+{
+ if (wkt.empty())
+ {
+ return;
+ }
+
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+
+ std::string caseid = id;
+
+//#ifdef GGL_DEBUG_INTERSECTION
+ std::cout << std::endl << std::endl << "# " << caseid << std::endl;
+//#endif
+ test_self_intersection_points::apply(caseid, expected, geometry, precision);
+}
+
+
+#if ! defined(GGL_TEST_MULTI)
+
+template <typename P>
+void test_self_all()
+{
+ typedef boost::geometry::polygon<P> polygon;
+
+ // Just a normal polygon
+ test_self_overlay<polygon>("1", boost::make_tuple(0, 0, 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<polygon>("2", boost::make_tuple(2, 2.40625, 2.125),
+ "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<polygon>("3", boost::make_tuple(1, 2, 2),
+ "POLYGON((0 2,2 4,2 0,4 2,0 2))");
+
+
+ // Self tangent
+
+ test_self_overlay<polygon>("4", boost::make_tuple(1, 2, 4),
+ "POLYGON((0 0,0 4,4 4,4 0,2 4,0 0))");
+
+
+ // Self tangent in corner
+
+ test_self_overlay<polygon>("5", boost::make_tuple(1, 0, 4),
+ "POLYGON((0 0,0 4,4 4,4 0,0 4,2 0,0 0))");
+
+
+ // With spike
+
+ test_self_overlay<polygon>("6", boost::make_tuple(1, 4, 2),
+ "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<polygon>("d1", boost::make_tuple(0, 0, 0),
+ "POLYGON((0 0,0 4,4 0,4 0,0 0))");
+
+
+ // With many duplicates
+
+ test_self_overlay<polygon>("d2", boost::make_tuple(0, 0, 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<polygon>("h1", boost::make_tuple(2, 2, 4),
+ "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 2,2 4,3 2,1 2))");
+
+
+ // Hole: interior intersecting exterior
+
+ test_self_overlay<polygon>("h2", boost::make_tuple(4, 4, 3.5),
+ "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<polygon>("h3", boost::make_tuple(4, 2.5, 2.5),
+ "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<polygon>("h4", boost::make_tuple(2, 2.06060606, 2.96969697),
+ "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<polygon>("case_1", boost::make_tuple(0, 0, 0),
+ "POLYGON((1 3,0 9,9 5,1 7,9 8,2 5,10 10,9 2,1 3))");
+
+
+ test_self_overlay<polygon>("toolkit_2", boost::make_tuple(2, 2.06060606, 2.96969697),
+ "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.332
44019 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<polygon>("ticket17", boost::make_tuple(2, -122.26657721, 37.38691), 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.35875
8 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 4
4.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.702
653,-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.8986
7 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.34350
6,-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.93213
8 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 4
4.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.2
90501,-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.25
3916,-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.20821
5,-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,-7
2.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<polygon>("uscounty_ne", boost::make_tuple(2, -122.26657721, 37.38691), uscounty_ne);
+
+
+
+}
+#endif
+
+
+
+#if ! defined(GGL_TEST_MULTI)
+int test_main(int, char* [])
+{
+ test_self_all<boost::geometry::point_xy<double> >();
+ return 0;
+}
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/self_intersection_points.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="self_intersection_points"
+ ProjectGUID="{06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}"
+ RootNamespace="self_intersection_points"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\self_intersection_points"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\self_intersection_points"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\self_intersection_points.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,639 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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 <iostream>
+#include <iomanip>
+#include <fstream>
+#include <sstream>
+#include <string>
+
+
+#include <ggl_test_common.hpp>
+
+//#define HAVE_TTMATH
+#ifdef HAVE_TTMATH
+# include <ttmath_stub.hpp>
+#endif
+
+
+
+#define BOOST_GEOMETRY_REPORT_OVERLAY_ERROR
+#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER
+
+//#define BOOST_GEOMETRY_DEBUG_OVERLAY_ONLY_ONE
+
+#if defined(_MSC_VER)
+# define BOOST_GEOMETRY_TEST_OVERLAY_NOT_REVERSED
+//# define BOOST_GEOMETRY_DEBUG_OVERLAY
+#else
+//# define BOOST_GEOMETRY_DEBUG_OVERLAY
+#endif
+
+
+#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/enrichment_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/traversal_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp>
+
+#include <boost/geometry/algorithms/overlay/get_turns.hpp>
+#include <boost/geometry/algorithms/overlay/enrich_intersection_points.hpp>
+#include <boost/geometry/algorithms/overlay/traverse.hpp>
+
+#include <boost/geometry/algorithms/area.hpp>
+
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <overlay_common.hpp>
+#include <overlay_cases.hpp>
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+template <boost::geometry::detail::overlay::operation_type Direction>
+struct test_traverse
+{
+#if defined(TEST_WITH_SVG)
+ static inline std::string operation(int d)
+ {
+ return d == 1 ? "union" : "intersection";
+ }
+#endif
+
+ template <typename G1, typename G2>
+ static void apply(std::string const& id,
+ boost::tuple<int, double> const& expected_count_area,
+ G1 const& g1, G2 const& g2,
+ double precision)
+ {
+ namespace bg = boost::geometry;
+
+ //std::cout << "TRAVERSE " << id << "(" << int(Direction) << ")" << std::endl;
+#ifdef BOOST_GEOMETRY_DEBUG_OVERLAY
+ //std::cerr << "TRAVERSE " << id << "(" << Direction << ")" << std::endl;
+
+ //std::cout << bg::area(g1) << " " << bg::area(g2) << std::endl;
+#endif
+
+ typedef typename bg::strategy_side
+ <
+ typename bg::cs_tag<G1>::type
+ >::type side_strategy_type;
+
+
+ typedef bg::detail::overlay::traversal_turn_info
+ <
+ typename boost::geometry::point_type<G2>::type
+ > turn_info;
+ std::vector<turn_info> turns;
+
+ bg::detail::get_turns::no_interrupt_policy policy;
+ bg::get_turns<bg::detail::overlay::calculate_distance_policy>(g1, g2, turns, policy);
+ bg::enrich_intersection_points(turns, g1, g2, side_strategy_type());
+
+ typedef bg::linear_ring<typename bg::point_type<G2>::type> ring_type;
+ typedef std::vector<ring_type> out_vector;
+ out_vector v;
+
+
+ bg::traverse(g1, g2, Direction, turns, v);
+
+ // Check number of resulting rings
+ BOOST_CHECK_MESSAGE(expected_count_area.get<0>() == boost::size(v),
+ "traverse: " << id
+ << " #shapes expected: " << expected_count_area.get<0>()
+ << " detected: " << boost::size(v)
+ << " type: " << string_from_type
+ <typename bg::coordinate_type<G1>::type>::name()
+ );
+
+ // Check total area of resulting rings
+ typename bg::area_result<G1>::type total_area = 0;
+ BOOST_FOREACH(ring_type const& ring, v)
+ {
+ total_area += bg::area(ring);
+ }
+
+#ifndef HAVE_TTMATH
+ BOOST_CHECK_CLOSE(expected_count_area.get<1>(), double(total_area), precision);
+#endif
+
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "traverse_" << operation(Direction)
+ << "_" << id
+ << "_" << string_from_type<typename bg::coordinate_type<G1>::type>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<typename bg::point_type<G2>::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.05;stroke-opacity:0.4;fill:rbg(255,255,128);"
+ "stroke:rgb(255,0,255);stroke-width:8");
+ }
+
+ // turn points in orange, + enrichment/traversal info
+ typedef typename bg::coordinate_type<G1>::type coordinate_type;
+
+ // Simple map to avoid two texts at same place (note that can still overlap!)
+ std::map<std::pair<coordinate_type, coordinate_type>, 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
+ std::pair<coordinate_type, coordinate_type> p
+ = std::make_pair(bg::get<0>(turn.point), bg::get<1>(turn.point));
+ std::string style = "fill:rgb(0,0,0);font-family:Arial;font-size:8px";
+
+ {
+ 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.ignore ? " (ignore) " : " ")
+ ;
+
+ offsets[p] += lineheight;
+ int offset = offsets[p];
+ mapper.text(turn.point, out.str(), style, margin, offset);
+ }
+
+ {
+ std::ostringstream out;
+ out << "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
+ << "]"
+ ;
+ }
+
+ offsets[p] += lineheight;
+ int offset = offsets[p];
+ mapper.text(turn.point, out.str(), style, margin, offset);
+ }
+
+
+ {
+ std::ostringstream out;
+ out << "vx:" << turn.operations[0].enriched.travels_to_vertex_index
+ << "/" << turn.operations[1].enriched.travels_to_vertex_index;
+
+ offsets[p] += lineheight;
+ int offset = offsets[p];
+ mapper.text(turn.point, out.str(), style, margin, offset);
+ }
+
+ {
+ std::ostringstream out;
+ out << std::setprecision(3)
+ << "dist: " << turn.operations[0].enriched.distance
+ << " / " << turn.operations[1].enriched.distance;
+
+ offsets[p] += lineheight;
+ int offset = offsets[p];
+ mapper.text(turn.point, out.str(), style, margin, offset);
+ }
+ }
+ index++;
+ }
+ }
+ #endif
+ }
+};
+
+
+#if ! defined(BOOST_GEOMETRY_TEST_MULTI)
+template <typename T>
+void test_all()
+{
+ namespace bg = boost::geometry;
+ using namespace boost::geometry::detail::overlay;
+
+ typedef bg::point<T, 2, bg::cs::cartesian> P;
+ typedef bg::polygon<P> polygon;
+ typedef bg::box<P> box;
+ typedef boost::tuple<int, double> Tuple;
+
+
+ std::cout << std::setprecision(10);
+
+#ifdef BOOST_GEOMETRY_DEBUG_OVERLAY_ONLY_ONE
+ {
+ // distance-zero-2
+ std::string dz[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_2",
+ boost::make_tuple(2, 68.678921274288541), dz[0], dz[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_2",
+ boost::make_tuple(2, 1505.4202304878663), dz[0], dz[1]);
+ }
+ return;
+#endif
+
+ /*
+ // SNL problem
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("snl-3",
+ boost::make_tuple(1, 99),
+ "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,18491
9.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,185
027.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 6069
60.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.5560000019904
691725969314575195 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.30099
999904632568359375))");
+
+ return;
+ */
+
+
+ // 1-6
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("1", boost::make_tuple(1, 5.4736), case_1[0], case_1[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("2", boost::make_tuple(1, 12.0545), case_2[0], case_2[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("3", boost::make_tuple(1, 5), case_3[0], case_3[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("4", boost::make_tuple(1, 10.2212), case_4[0], case_4[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("5", boost::make_tuple(2, 12.8155), case_5[0], case_5[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("6", boost::make_tuple(1, 4.5), case_6[0], case_6[1]);
+
+ // 7-12
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("7", boost::make_tuple(0, 0), case_7[0], case_7[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("8", boost::make_tuple(0, 0), case_8[0], case_8[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("9", boost::make_tuple(0, 0), case_9[0], case_9[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("10", boost::make_tuple(0, 0), case_10[0], case_10[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("11", boost::make_tuple(1, 1), case_11[0], case_11[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("12", boost::make_tuple(2, 0.63333), case_12[0], case_12[1]);
+
+ // 13-18
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("13", boost::make_tuple(0, 0), case_13[0], case_13[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("14", boost::make_tuple(0, 0), case_14[0], case_14[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("15", boost::make_tuple(0, 0), case_15[0], case_15[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("16", boost::make_tuple(0, 0), case_16[0], case_16[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("17", boost::make_tuple(1, 2), case_17[0], case_17[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("18", boost::make_tuple(1, 2), case_18[0], case_18[1]);
+
+ // 19-24
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("19", boost::make_tuple(0, 0), case_19[0], case_19[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("20", boost::make_tuple(1, 5.5), case_20[0], case_20[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("21", boost::make_tuple(0, 0), case_21[0], case_21[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("22", boost::make_tuple(0, 0), case_22[0], case_22[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("23", boost::make_tuple(1, 1.4), case_23[0], case_23[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("24", boost::make_tuple(1, 1.0), case_24[0], case_24[1]);
+
+ // 25-30
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("25", boost::make_tuple(0, 0), case_25[0], case_25[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("26", boost::make_tuple(0, 0), case_26[0], case_26[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("27", boost::make_tuple(1, 0.9545454), case_27[0], case_27[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("28", boost::make_tuple(1, 0.9545454), case_28[0], case_28[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("29", boost::make_tuple(1, 1.4), case_29[0], case_29[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("30", boost::make_tuple(1, 0.5), case_30[0], case_30[1]);
+
+ // 31-36
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("31", boost::make_tuple(0, 0), case_31[0], case_31[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("32", boost::make_tuple(0, 0), case_32[0], case_32[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("33", boost::make_tuple(0, 0), case_33[0], case_33[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("34", boost::make_tuple(1, 0.5), case_34[0], case_34[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("35", boost::make_tuple(1, 1.0), case_35[0], case_35[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("36", boost::make_tuple(1, 1.625), case_36[0], case_36[1]);
+
+ // 37-42
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("37", boost::make_tuple(2, 0.666666), case_37[0], case_37[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("38", boost::make_tuple(2, 0.971429), case_38[0], case_38[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("39", boost::make_tuple(1, 24), case_39[0], case_39[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("40", boost::make_tuple(0, 0), case_40[0], case_40[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("41", boost::make_tuple(1, 5), case_41[0], case_41[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("42", boost::make_tuple(1, 5), case_42[0], case_42[1]);
+
+ // 43-48
+ //test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("43", boost::make_tuple(2, 0.75), case_43[0], case_43[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("44", boost::make_tuple(1, 44), case_44[0], case_44[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("45", boost::make_tuple(1, 45), case_45[0], case_45[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("46", boost::make_tuple(1, 46), case_46[0], case_46[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("47", boost::make_tuple(1, 47), case_47[0], case_47[1]);
+
+ // 49-54
+
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("50", boost::make_tuple(0, 0), case_50[0], case_50[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("51", boost::make_tuple(0, 0), case_51[0], case_51[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("52", boost::make_tuple(1, 10.5), case_52[0], case_52[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("53a", boost::make_tuple(0, 0), case_53[0], case_53[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("53b", boost::make_tuple(0, 0), case_53[0], case_53[2]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("54aa", boost::make_tuple(1, 2), case_54[0], case_54[2]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("54ab", boost::make_tuple(1, 2), case_54[0], case_54[3]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("54ba", boost::make_tuple(1, 2), case_54[1], case_54[2]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("54bb", boost::make_tuple(1, 2), case_54[1], case_54[3]);
+
+ // 55-60
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("55", boost::make_tuple(1, 2), case_55[0], case_55[1]);
+
+
+ // other
+
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("collinear_overlaps", boost::make_tuple(1, 24), collinear_overlaps[0], collinear_overlaps[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("many_situations", boost::make_tuple(1, 184), case_many_situations[0], case_many_situations[1]);
+
+
+ // pies (went wrong when not all cases where implemented, especially some collinear (opposite) cases
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("pie_16_4_12",
+ boost::make_tuple(1, 491866.5), pie_16_4_12[0], pie_16_4_12[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("pie_23_21_12_500",
+ boost::make_tuple(2, 2363199.3313), pie_23_21_12_500[0], pie_23_21_12_500[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("pie_23_23_3_2000",
+ boost::make_tuple(2, 1867779.9349), pie_23_23_3_2000[0], pie_23_23_3_2000[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("pie_23_16_16",
+ boost::make_tuple(2, 2128893.9555), pie_23_16_16[0], pie_23_16_16[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("pie_16_2_15_0",
+ boost::make_tuple(0, 0), pie_16_2_15_0[0], pie_16_2_15_0[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("pie_4_13_15",
+ boost::make_tuple(1, 490887.06678), pie_4_13_15[0], pie_4_13_15[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("pie_20_20_7_100",
+ boost::make_tuple(2, 2183372.2718), pie_20_20_7_100[0], pie_20_20_7_100[1]);
+
+
+ // 1-6
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("1", boost::make_tuple(1, 11.5264), case_1[0], case_1[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("2", boost::make_tuple(1, 17.9455), case_2[0], case_2[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("3", boost::make_tuple(1, 9), case_3[0], case_3[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("4", boost::make_tuple(3, 17.7788), case_4[0], case_4[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("5", boost::make_tuple(2, 18.4345), case_5[0], case_5[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("6", boost::make_tuple(1, 9), case_6[0], case_6[1]);
+
+ // 7-12
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("7", boost::make_tuple(1, 9), case_7[0], case_7[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("8", boost::make_tuple(1, 12), case_8[0], case_8[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("9", boost::make_tuple(0, 0), case_9[0], case_9[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("10", boost::make_tuple(1, 9), case_10[0], case_10[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("11", boost::make_tuple(1, 8), case_11[0], case_11[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("12", boost::make_tuple(2, 8.36667), case_12[0], case_12[1]);
+
+ // 13-18
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("13", boost::make_tuple(1, 4), case_13[0], case_13[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("14", boost::make_tuple(1, 12), case_14[0], case_14[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("15", boost::make_tuple(1, 12), case_15[0], case_15[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("16", boost::make_tuple(1, 9), case_16[0], case_16[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("17", boost::make_tuple(1, 8), case_17[0], case_17[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("18", boost::make_tuple(1, 8), case_18[0], case_18[1]);
+
+ // 19-24
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("19", boost::make_tuple(1, 10), case_19[0], case_19[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("20", boost::make_tuple(1, 5.5), case_20[0], case_20[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("21", boost::make_tuple(0, 0), case_21[0], case_21[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("22", boost::make_tuple(0, 0), case_22[0], case_22[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("23", boost::make_tuple(1, 6.1), case_23[0], case_23[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("24", boost::make_tuple(1, 5.5), case_24[0], case_24[1]);
+
+ // 25-30
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("25", boost::make_tuple(0, 0), case_25[0], case_25[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("26", boost::make_tuple(0, 0), case_26[0], case_26[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("27", boost::make_tuple(1, 8.04545), case_27[0], case_27[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("28", boost::make_tuple(1, 10.04545), case_28[0], case_28[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("29", boost::make_tuple(1, 8.1), case_29[0], case_29[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("30", boost::make_tuple(1, 6.5), case_30[0], case_30[1]);
+
+ // 31-36
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("31", boost::make_tuple(0, 0), case_31[0], case_31[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("32", boost::make_tuple(0, 0), case_32[0], case_32[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("33", boost::make_tuple(0, 0), case_33[0], case_33[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("34", boost::make_tuple(1, 6.0), case_34[0], case_34[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("35", boost::make_tuple(1, 10.5), case_35[0], case_35[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("36", boost::make_tuple(1, 14.375), case_36[0], case_36[1]);
+
+ // 37-42
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("37", boost::make_tuple(1, 7.33333), case_37[0], case_37[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("38", boost::make_tuple(1, 9.52857), case_38[0], case_38[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("39", boost::make_tuple(1, 40.0), case_39[0], case_39[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("40", boost::make_tuple(0, 0), case_40[0], case_40[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("41", boost::make_tuple(1, 5), case_41[0], case_41[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("42", boost::make_tuple(1, 5), case_42[0], case_42[1]);
+
+ // 43-48
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("43", boost::make_tuple(3, 8.1875), case_43[0], case_43[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("44", boost::make_tuple(1, 44), case_44[0], case_44[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("45", boost::make_tuple(1, 45), case_45[0], case_45[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("46", boost::make_tuple(1, 46), case_46[0], case_46[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("47", boost::make_tuple(1, 47), case_47[0], case_47[1]);
+
+ // 49-54
+
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("50", boost::make_tuple(1, 25), case_50[0], case_50[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("51", boost::make_tuple(0, 0), case_51[0], case_51[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("52", boost::make_tuple(1, 15.5), case_52[0], case_52[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("53a", boost::make_tuple(2, 16), case_53[0], case_53[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("53b", boost::make_tuple(2, 16), case_53[0], case_53[2]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("54aa", boost::make_tuple(2, 20), case_54[0], case_54[2]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("54ab", boost::make_tuple(2, 20), case_54[0], case_54[3]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("54ba", boost::make_tuple(2, 20), case_54[1], case_54[2]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("54bb", boost::make_tuple(2, 20), case_54[1], case_54[3]);
+
+
+ // 55-60
+ // 55 is going wrong!
+ // TODO: implement "node" behaviour which merges nodes
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("55", boost::make_tuple(3, 18), case_55[0], case_55[1]);
+
+ // other
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("collinear_overlaps",
+ boost::make_tuple(1, 50), collinear_overlaps[0], collinear_overlaps[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("many_situations",
+ boost::make_tuple(1, 207), case_many_situations[0], case_many_situations[1]);
+
+
+ // pies (went wrong when not all cases where implemented, especially some collinear (opposite) cases
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("pie_16_4_12",
+ boost::make_tuple(1, 3669665.5), pie_16_4_12[0], pie_16_4_12[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("pie_23_21_12_500",
+ boost::make_tuple(1, 6295516.7185), pie_23_21_12_500[0], pie_23_21_12_500[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("pie_23_23_3_2000",
+ boost::make_tuple(1, 7118735.0530), pie_23_23_3_2000[0], pie_23_23_3_2000[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("pie_23_16_16",
+ boost::make_tuple(1, 5710474.5406), pie_23_16_16[0], pie_23_16_16[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("pie_16_2_15_0",
+ boost::make_tuple(1, 3833641.5), pie_16_2_15_0[0], pie_16_2_15_0[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("pie_4_13_15",
+ boost::make_tuple(1, 2208122.43322), pie_4_13_15[0], pie_4_13_15[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("pie_20_20_7_100",
+ boost::make_tuple(1, 5577158.72823), pie_20_20_7_100[0], pie_20_20_7_100[1]);
+
+
+ // From "Random Ellipse Stars", this all went wrong
+ // when using Determinant/ra/rb and comparing with 0/1
+ // Solved now.
+ // ("hv" means "high volume")
+ {
+ std::string hv[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv1", boost::make_tuple(1, 1624.508688461573), hv[0], hv[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv1", boost::make_tuple(1, 1622.7200125123809), hv[0], hv[1], 0.1);
+ }
+ {
+ std::string hv[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv2", boost::make_tuple(1, 1622.9193392726836), hv[0], hv[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv2", boost::make_tuple(1, 1622.1733591429329), hv[0], hv[1], 0.1);
+ }
+ {
+ std::string hv[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv3", boost::make_tuple(1, 1624.22079205664), hv[0], hv[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv3", boost::make_tuple(1, 1623.8265057282042), hv[0], hv[1], 0.1);
+ }
+ {
+ std::string hv[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv4", boost::make_tuple(1, 1626.5146964146334), hv[0], hv[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv4", boost::make_tuple(1, 1626.2580370864305), hv[0], hv[1], 0.1);
+ }
+ {
+ std::string hv[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv5", boost::make_tuple(1, 1624.2158307261871), hv[0], hv[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv5", boost::make_tuple(1, 1623.4506071521519), hv[0], hv[1], 0.1);
+ }
+
+
+ // Case 2009-12-07
+ {
+ std::string hv[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv6", boost::make_tuple(1, 1604.6318757402121), hv[0], hv[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv6", boost::make_tuple(1, 1790.091872401327), hv[0], hv[1], 0.1);
+ }
+
+ // Case 2009-12-08, needing sorting on side in enrich_intersection_points
+ {
+ std::string hv[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv7", boost::make_tuple(1, 1624.5779453641017), hv[0], hv[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv7", boost::make_tuple(1, 1623.6936420295772), hv[0], hv[1], 0.1);
+ }
+
+
+ // From "Random Ellipse Stars", this all went wrong
+ // when distances was 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 (by sorting on sides instead of on distance)
+ {
+ // distance-zero-1
+ std::string dz[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_1",
+ boost::make_tuple(3, 16.887537949472005), dz[0], dz[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_1",
+ boost::make_tuple(3, 1444.2621305732864), dz[0], dz[1]);
+ }
+ {
+ // distance-zero-2
+ std::string dz[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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_2",
+ boost::make_tuple(2, 68.678921274288541), dz[0], dz[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_2",
+ boost::make_tuple(2, 1505.4202304878663), dz[0], dz[1]);
+ }
+
+ {
+ // distance-zero-3
+ std::string dz[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 7
3.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))"
+ };
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_3",
+ boost::make_tuple(6, 192.49316937645651), dz[0], dz[1]);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_3",
+ boost::make_tuple(6, 1446.496005965641), dz[0], dz[1]);
+ }
+ return;
+
+
+ return;
+
+ // They still have errors
+
+ // ticket#17
+ test_overlay<polygon, box, test_traverse<operation_intersection>, Tuple>("ticket_17", boost::make_tuple(2, 2.687433027e-006), ticket_17[0], ticket_17[1], 0.1);
+ test_overlay<polygon, box, test_traverse<operation_union>, Tuple>("ticket_17", boost::make_tuple(3, 0.00922511561516), ticket_17[0], ticket_17[1], 0.1);
+
+ // Boost.List during Formal Review, isovists Brandon
+ // For FP, they may deviate more.
+ /***
+ static const bool is_float = string_from_type<T>::name() == std::string("f");
+ static const bool is_double = string_from_type<T>::name() == std::string("d");
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("isov",
+ boost::make_tuple(1, 88.19203119), isovist[0], isovist[1],
+ is_float || is_double ? 1.0 : 0.01);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("isov",
+ boost::make_tuple(1, 313.3603646234), isovist[0], isovist[1],
+ is_float || is_double ? 1.0 : 0.01);
+ ***/
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<float>();
+ test_all<double>();
+#ifdef HAVE_TTMATH
+ test_all<tt>();
+#endif
+
+#if ! defined(_MSC_VER)
+ test_all<long double>();
+#endif
+#if defined(HAVE_CLN)
+ test_all<boost::numeric_adaptor::cln_value_type>();
+#endif
+#if defined(HAVE_GMP)
+ test_all<boost::numeric_adaptor::gmp_value_type>();
+#endif
+ return 0;
+}
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="traverse"
+ ProjectGUID="{6260214E-DB6F-4934-ADF7-DD2B1666171B}"
+ RootNamespace="traverse"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\traverse"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../..;c:\svn\msm"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\traverse"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../..;c:\svn\msm"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\traverse.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse_gmp.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,216 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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
+
+//#define GGL_DEBUG_INTERSECTION
+
+
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <fstream>
+
+#include <boost/numeric_adaptor/numeric_adaptor.hpp>
+#include <boost/numeric_adaptor/gmp_value_type.hpp>
+
+#if defined(HAVE_CLN)
+# include <boost/numeric_adaptor/cln_value_type.hpp>
+#endif
+
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/enrichment_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/traversal_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp>
+#include <boost/geometry/algorithms/overlay/get_turns.hpp>
+#include <boost/geometry/algorithms/overlay/enrich_intersection_points.hpp>
+#include <boost/geometry/algorithms/overlay/traverse.hpp>
+
+
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#define TEST_WITH_SVG
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+
+
+template <typename OutputType, typename G1, typename G2>
+void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2)
+{
+
+ typedef boost::geometry::detail::intersection::intersection_point
+ <typename boost::geometry::point_type<G2>::type> ip;
+ typedef typename boost::range_const_iterator<std::vector<ip> >::type iterator;
+ typedef std::vector<ip> ip_vector;
+ ip_vector ips;
+
+ typedef typename boost::geometry::strategy_side
+ <
+ typename boost::geometry::cs_tag<G1>::type
+ >::type strategy_type;
+
+
+ typedef bg::detail::overlay::traversal_turn_info
+ <
+ typename boost::geometry::point_type<G2>::type
+ > turn_info;
+ typedef typename boost::range_iterator<const std::vector<turn_info> >::type iterator;
+ std::vector<turn_info> ips;
+
+ bg::get_turns<bg::detail::overlay::calculate_distance_policy>(g1, g2, ips);
+ boost::geometry::enrich_intersection_points(ips, g1, g2, strategy_type());
+
+ typedef boost::geometry::linear_ring<typename boost::geometry::point_type<G2>::type> ring_type;
+ typedef std::vector<ring_type> out_vector;
+ out_vector v;
+
+
+
+ boost::geometry::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 boost::geometry::point_xy<long double> P;
+ typedef typename boost::geometry::point_type<G1>::type P;
+ //typename boost::geometry::replace_point_type<G1, P>::type rg1;
+ //typename boost::geometry::replace_point_type<G2, P>::type rg2;
+
+
+
+ svg_mapper<P> 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 << boost::geometry::wkt(*it) << std::endl;
+ std::cout << boost::geometry::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 <typename OutputType, typename G1, typename G2>
+void test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2)
+{
+ G1 g1;
+ boost::geometry::read_wkt(wkt1, g1);
+
+ G2 g2;
+ boost::geometry::read_wkt(wkt2, g2);
+
+ boost::geometry::correct(g1);
+ boost::geometry::correct(g2);
+ std::cout << "area1 " << boost::geometry::area(g1) << " " << " area2: " << boost::geometry::area(g2) << std::endl;
+
+ test_traverse<OutputType>(caseid, g1, g2);
+}
+
+
+#if ! defined(GGL_TEST_MULTI)
+
+template <typename P>
+void test_traverse_gmp(std::string const& caseid)
+{
+ typedef boost::geometry::polygon<P> polygon;
+ std::cout << typeid(typename boost::geometry::coordinate_type<P>::type).name() << std::endl;
+ std::cout << std::setprecision(30) << std::numeric_limits<float>::epsilon() << std::endl;
+ std::cout << std::setprecision(30) << std::numeric_limits<double>::epsilon() << std::endl;
+ std::cout << std::setprecision(30) << std::numeric_limits<long double>::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.22
6280212402344 -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.223842620849
609,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.0698
89344709196 -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<polygon, polygon, polygon>(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<boost::geometry::point_xy<float> >("float");
+ break;
+ case 2 :
+ test_traverse_gmp<boost::geometry::point_xy<double> >("double");
+ break;
+ case 3 :
+ test_traverse_gmp<boost::geometry::point_xy<long double> >("long double");
+ break;
+ case 4 :
+ #if defined(HAVE_GMP)
+ test_traverse_gmp<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >("gmp");
+ #endif
+ break;
+ case 5 :
+ #if defined(HAVE_CLN)
+ test_traverse_gmp<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >("cln");
+ #endif
+
+ break;
+ }
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/perimeter.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/perimeter.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,42 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/geometries/geometries.hpp>
+
+#include <algorithms/test_perimeter.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ // 3-4-5 triangle
+ //test_geometry<std::pair<P, P> >("LINESTRING(0 0,3 4)", 5);
+
+ test_geometry<boost::geometry::linear_ring<P> >(
+ "POLYGON((0 0,0 1,1 1,1 0,0 0))", 4);
+ test_geometry<boost::geometry::polygon<P> >(
+ "POLYGON((0 0,0 1,1 0,0 0))", 1.0 + 1.0 + sqrt(2.0));
+ test_geometry<boost::geometry::polygon<P> >(
+ "POLYGON((0 0,0 4,4 4,4 0,0 0),(1 1,2 1,2 2,1 2,1 1))", 20);
+}
+
+int test_main(int, char* [])
+{
+ //test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/perimeter.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/perimeter.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="perimeter"
+ ProjectGUID="{EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}"
+ RootNamespace="perimeter"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\perimeter"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\perimeter"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\perimeter.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/sectionalize.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/sectionalize.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,170 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <string>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/algorithms/sectionalize.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+#include <test_common/test_point.hpp>
+
+template <int DimensionCount, typename G>
+void test_sectionalize(G const& g, int section_count,
+ std::string const& index_check, std::string const& dir_check,
+ bool sort = false)
+{
+ typedef typename boost::geometry::point_type<G>::type point;
+ typedef boost::geometry::box<point> box;
+ typedef boost::geometry::sections<box, DimensionCount> sections;
+
+ sections s;
+ boost::geometry::sectionalize(g, s);
+
+ BOOST_CHECK_EQUAL(s.size(), section_count);
+
+ // Output streams for sections, boxes, other
+ std::ostringstream out_sections;
+ std::ostringstream out_boxes;
+ std::ostringstream out_dirs;
+
+ if (sort)
+ {
+ //std::sort(boost::begin(s), boost::end(s)); NOW DONE WITH comparator
+ }
+
+ 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 << boost::geometry::get<0,0>(b) << " " << boost::geometry::get<0,1>(b)
+ << ".." << boost::geometry::get<1,0>(b) << " " << boost::geometry::get<1,1>(b);
+ for (int d = 0; d < DimensionCount; 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);
+ }
+ else
+ {
+ if (out_sections.str().length() < 80)
+ {
+ std::cout << std::endl << boost::geometry::wkt(g) << std::endl;
+ std::cout << out_sections.str() << std::endl;
+ //std::cout << out_boxes.str() << std::endl;
+ }
+ std::cout << out_dirs.str() << std::endl;
+ }
+}
+
+template <typename G>
+void test_sectionalize(std::string const& wkt,
+ int count2, std::string const& s2, std::string const d2,
+ int count1, std::string const& s1, std::string const d1,
+ bool sort = false)
+{
+ G g;
+ boost::geometry::read_wkt(wkt, g);
+ test_sectionalize<2>(g, count2, s2, d2, sort);
+ test_sectionalize<1>(g, count1, s1, d1, sort);
+}
+
+template <typename P>
+void test_all()
+{
+ test_sectionalize<boost::geometry::polygon<P> >(
+ "POLYGON((0 0,0 380,400 380,400 0,0 0),(1 1,7 5,5 7,1 1),(1 11,7 15,5 17,1 11),(1 21,7 25,5 27,1 21),(1 31,7 35,5 37,1 31),(1 41,7 45,5 47,1 41),(1 51,7 55,5 57,1 51),(1 61,7 65,5 67,1 61),(1 71,7 75,5 77,1 71),(1 81,7 85,5 87,1 81),(1 91,7 95,5 97,1 91),(1 101,7 105,5 107,1 101),(1 111,7 115,5 117,1 111),(1 121,7 125,5 127,1 121),(1 131,7 135,5 137,1 131),(1 141,7 145,5 147,1 141),(1 151,7 155,5 157,1 151),(1 161,7 165,5 167,1 161),(1 171,7 175,5 177,1 171),(1 181,7 185,5 187,1 181),(11 1,17 5,15 7,11 1),(11 11,17 15,15 17,11 11),(11 21,17 25,15 27,11 21),(11 31,17 35,15 37,11 31),(11 41,17 45,15 47,11 41),(11 51,17 55,15 57,11 51),(11 61,17 65,15 67,11 61),(11 71,17 75,15 77,11 71),(11 81,17 85,15 87,11 81),(11 91,17 95,15 97,11 91),(11 101,17 105,15 107,11 101),(11 111,17 115,15 117,11 111),(11 121,17 125,15 127,11 121),(11 131,17 135,15 137,11 131),(11 141,17 145,15 147,11 141),(11 151,17 155,15 157,11 151),(11 161,17 165,15 167,11 161),(11 171,17 175,15 177,11 171),(11 181,17 185,15 187,11 181)
,(21 1,27 5,25 7,21 1),(21 11,27 15,25 17,21 11),(21 21,27 25,25 27,21 21),(21 31,27 35,25 37,21 31),(21 41,27 45,25 47,21 41),(21 51,27 55,25 57,21 51),(21 61,27 65,25 67,21 61),(21 71,27 75,25 77,21 71),(21 81,27 85,25 87,21 81),(21 91,27 95,25 97,21 91),(21 101,27 105,25 107,21 101),(21 111,27 115,25 117,21 111),(21 121,27 125,25 127,21 121),(21 131,27 135,25 137,21 131),(21 141,27 145,25 147,21 141),(21 151,27 155,25 157,21 151),(21 161,27 165,25 167,21 161),(21 171,27 175,25 177,21 171),(21 181,27 185,25 187,21 181),(31 1,37 5,35 7,31 1),(31 11,37 15,35 17,31 11),(31 21,37 25,35 27,31 21),(31 31,37 35,35 37,31 31),(31 41,37 45,35 47,31 41),(31 51,37 55,35 57,31 51),(31 61,37 65,35 67,31 61),(31 71,37 75,35 77,31 71),(31 81,37 85,35 87,31 81),(31 91,37 95,35 97,31 91),(31 101,37 105,35 107,31 101),(31 111,37 115,35 117,31 111),(31 121,37 125,35 127,31 121),(31 131,37 135,35 137,31 131),(31 141,37 145,35 147,31 141),(31 151,37 155,35 157,31 151),(31 161,37 165,35 167,31 161),(31 171,37 175,35 177,31 171),
(31 181,37 185,35 187,31 181),(41 1,47 5,45 7,41 1),(41 11,47 15,45 17,41 11),(41 21,47 25,45 27,41 21),(41 31,47 35,45 37,41 31),(41 41,47 45,45 47,41 41),(41 51,47 55,45 57,41 51),(41 61,47 65,45 67,41 61),(41 71,47 75,45 77,41 71),(41 81,47 85,45 87,41 81),(41 91,47 95,45 97,41 91),(41 101,47 105,45 107,41 101),(41 111,47 115,45 117,41 111),(41 121,47 125,45 127,41 121),(41 131,47 135,45 137,41 131),(41 141,47 145,45 147,41 141),(41 151,47 155,45 157,41 151),(41 161,47 165,45 167,41 161),(41 171,47 175,45 177,41 171),(41 181,47 185,45 187,41 181),(51 1,57 5,55 7,51 1),(51 11,57 15,55 17,51 11),(51 21,57 25,55 27,51 21),(51 31,57 35,55 37,51 31),(51 41,57 45,55 47,51 41),(51 51,57 55,55 57,51 51),(51 61,57 65,55 67,51 61),(51 71,57 75,55 77,51 71),(51 81,57 85,55 87,51 81),(51 91,57 95,55 97,51 91),(51 101,57 105,55 107,51 101),(51 111,57 115,55 117,51 111),(51 121,57 125,55 127,51 121),(51 131,57 135,55 137,51 131),(51 141,57 145,55 147,51 141),(51 151,57 155,55 157,51 151),(51 161,57 165,55 167,51 161),(
51 171,57 175,55 177,51 171),(51 181,57 185,55 187,51 181),(61 1,67 5,65 7,61 1),(61 11,67 15,65 17,61 11),(61 21,67 25,65 27,61 21),(61 31,67 35,65 37,61 31),(61 41,67 45,65 47,61 41),(61 51,67 55,65 57,61 51),(61 61,67 65,65 67,61 61),(61 71,67 75,65 77,61 71),(61 81,67 85,65 87,61 81),(61 91,67 95,65 97,61 91),(61 101,67 105,65 107,61 101),(61 111,67 115,65 117,61 111),(61 121,67 125,65 127,61 121),(61 131,67 135,65 137,61 131),(61 141,67 145,65 147,61 141),(61 151,67 155,65 157,61 151),(61 161,67 165,65 167,61 161),(61 171,67 175,65 177,61 171),(61 181,67 185,65 187,61 181),(71 1,77 5,75 7,71 1),(71 11,77 15,75 17,71 11),(71 21,77 25,75 27,71 21),(71 31,77 35,75 37,71 31),(71 41,77 45,75 47,71 41),(71 51,77 55,75 57,71 51),(71 61,77 65,75 67,71 61),(71 71,77 75,75 77,71 71),(71 81,77 85,75 87,71 81),(71 91,77 95,75 97,71 91),(71 101,77 105,75 107,71 101),(71 111,77 115,75 117,71 111),(71 121,77 125,75 127,71 121),(71 131,77 135,75 137,71 131),(71 141,77 145,75 147,71 141),(71 151,77 155,75 157,71 151),(7
1 161,77 165,75 167,71 161),(71 171,77 175,75 177,71 171),(71 181,77 185,75 187,71 181),(81 1,87 5,85 7,81 1),(81 11,87 15,85 17,81 11),(81 21,87 25,85 27,81 21),(81 31,87 35,85 37,81 31),(81 41,87 45,85 47,81 41),(81 51,87 55,85 57,81 51),(81 61,87 65,85 67,81 61),(81 71,87 75,85 77,81 71),(81 81,87 85,85 87,81 81),(81 91,87 95,85 97,81 91),(81 101,87 105,85 107,81 101),(81 111,87 115,85 117,81 111),(81 121,87 125,85 127,81 121),(81 131,87 135,85 137,81 131),(81 141,87 145,85 147,81 141),(81 151,87 155,85 157,81 151),(81 161,87 165,85 167,81 161),(81 171,87 175,85 177,81 171),(81 181,87 185,85 187,81 181),(91 1,97 5,95 7,91 1),(91 11,97 15,95 17,91 11),(91 21,97 25,95 27,91 21),(91 31,97 35,95 37,91 31),(91 41,97 45,95 47,91 41),(91 51,97 55,95 57,91 51),(91 61,97 65,95 67,91 61),(91 71,97 75,95 77,91 71),(91 81,97 85,95 87,91 81),(91 91,97 95,95 97,91 91),(91 101,97 105,95 107,91 101),(91 111,97 115,95 117,91 111),(91 121,97 125,95 127,91 121),(91 131,97 135,95 137,91 131),(91 141,97 145,95 147,91 141),(91
 151,97 155,95 157,91 151),(91 161,97 165,95 167,91 161),(91 171,97 175,95 177,91 171),(91 181,97 185,95 187,91 181),(101 1,107 5,105 7,101 1),(101 11,107 15,105 17,101 11),(101 21,107 25,105 27,101 21),(101 31,107 35,105 37,101 31),(101 41,107 45,105 47,101 41),(101 51,107 55,105 57,101 51),(101 61,107 65,105 67,101 61),(101 71,107 75,105 77,101 71),(101 81,107 85,105 87,101 81),(101 91,107 95,105 97,101 91),(101 101,107 105,105 107,101 101),(101 111,107 115,105 117,101 111),(101 121,107 125,105 127,101 121),(101 131,107 135,105 137,101 131),(101 141,107 145,105 147,101 141),(101 151,107 155,105 157,101 151),(101 161,107 165,105 167,101 161),(101 171,107 175,105 177,101 171),(101 181,107 185,105 187,101 181),(111 1,117 5,115 7,111 1),(111 11,117 15,115 17,111 11),(111 21,117 25,115 27,111 21),(111 31,117 35,115 37,111 31),(111 41,117 45,115 47,111 41),(111 51,117 55,115 57,111 51),(111 61,117 65,115 67,111 61),(111 71,117 75,115 77,111 71),(111 81,117 85,115 87,111 81),(111 91,117 95,115 97,111 91),(111 101
,117 105,115 107,111 101),(111 111,117 115,115 117,111 111),(111 121,117 125,115 127,111 121),(111 131,117 135,115 137,111 131),(111 141,117 145,115 147,111 141),(111 151,117 155,115 157,111 151),(111 161,117 165,115 167,111 161),(111 171,117 175,115 177,111 171),(111 181,117 185,115 187,111 181),(121 1,127 5,125 7,121 1),(121 11,127 15,125 17,121 11),(121 21,127 25,125 27,121 21),(121 31,127 35,125 37,121 31),(121 41,127 45,125 47,121 41),(121 51,127 55,125 57,121 51),(121 61,127 65,125 67,121 61),(121 71,127 75,125 77,121 71),(121 81,127 85,125 87,121 81),(121 91,127 95,125 97,121 91),(121 101,127 105,125 107,121 101),(121 111,127 115,125 117,121 111),(121 121,127 125,125 127,121 121),(121 131,127 135,125 137,121 131),(121 141,127 145,125 147,121 141),(121 151,127 155,125 157,121 151),(121 161,127 165,125 167,121 161),(121 171,127 175,125 177,121 171),(121 181,127 185,125 187,121 181),(131 1,137 5,135 7,131 1),(131 11,137 15,135 17,131 11),(131 21,137 25,135 27,131 21),(131 31,137 35,135 37,131 31),(131 41
,137 45,135 47,131 41),(131 51,137 55,135 57,131 51),(131 61,137 65,135 67,131 61),(131 71,137 75,135 77,131 71),(131 81,137 85,135 87,131 81),(131 91,137 95,135 97,131 91),(131 101,137 105,135 107,131 101),(131 111,137 115,135 117,131 111),(131 121,137 125,135 127,131 121),(131 131,137 135,135 137,131 131),(131 141,137 145,135 147,131 141),(131 151,137 155,135 157,131 151),(131 161,137 165,135 167,131 161),(131 171,137 175,135 177,131 171),(131 181,137 185,135 187,131 181),(141 1,147 5,145 7,141 1),(141 11,147 15,145 17,141 11),(141 21,147 25,145 27,141 21),(141 31,147 35,145 37,141 31),(141 41,147 45,145 47,141 41),(141 51,147 55,145 57,141 51),(141 61,147 65,145 67,141 61),(141 71,147 75,145 77,141 71),(141 81,147 85,145 87,141 81),(141 91,147 95,145 97,141 91),(141 101,147 105,145 107,141 101),(141 111,147 115,145 117,141 111),(141 121,147 125,145 127,141 121),(141 131,147 135,145 137,141 131),(141 141,147 145,145 147,141 141),(141 151,147 155,145 157,141 151),(141 161,147 165,145 167,141 161),(141 171,1
47 175,145 177,141 171),(141 181,147 185,145 187,141 181),(151 1,157 5,155 7,151 1),(151 11,157 15,155 17,151 11),(151 21,157 25,155 27,151 21),(151 31,157 35,155 37,151 31),(151 41,157 45,155 47,151 41),(151 51,157 55,155 57,151 51),(151 61,157 65,155 67,151 61),(151 71,157 75,155 77,151 71),(151 81,157 85,155 87,151 81),(151 91,157 95,155 97,151 91),(151 101,157 105,155 107,151 101),(151 111,157 115,155 117,151 111),(151 121,157 125,155 127,151 121),(151 131,157 135,155 137,151 131),(151 141,157 145,155 147,151 141),(151 151,157 155,155 157,151 151),(151 161,157 165,155 167,151 161),(151 171,157 175,155 177,151 171),(151 181,157 185,155 187,151 181),(161 1,167 5,165 7,161 1),(161 11,167 15,165 17,161 11),(161 21,167 25,165 27,161 21),(161 31,167 35,165 37,161 31),(161 41,167 45,165 47,161 41),(161 51,167 55,165 57,161 51),(161 61,167 65,165 67,161 61),(161 71,167 75,165 77,161 71),(161 81,167 85,165 87,161 81),(161 91,167 95,165 97,161 91),(161 101,167 105,165 107,161 101),(161 111,167 115,165 117,161 111)
,(161 121,167 125,165 127,161 121),(161 131,167 135,165 137,161 131),(161 141,167 145,165 147,161 141),(161 151,167 155,165 157,161 151),(161 161,167 165,165 167,161 161),(161 171,167 175,165 177,161 171),(161 181,167 185,165 187,161 181),(171 1,177 5,175 7,171 1),(171 11,177 15,175 17,171 11),(171 21,177 25,175 27,171 21),(171 31,177 35,175 37,171 31),(171 41,177 45,175 47,171 41),(171 51,177 55,175 57,171 51),(171 61,177 65,175 67,171 61),(171 71,177 75,175 77,171 71),(171 81,177 85,175 87,171 81),(171 91,177 95,175 97,171 91),(171 101,177 105,175 107,171 101),(171 111,177 115,175 117,171 111),(171 121,177 125,175 127,171 121),(171 131,177 135,175 137,171 131),(171 141,177 145,175 147,171 141),(171 151,177 155,175 157,171 151),(171 161,177 165,175 167,171 161),(171 171,177 175,175 177,171 171),(171 181,177 185,175 187,171 181),(181 1,187 5,185 7,181 1),(181 11,187 15,185 17,181 11),(181 21,187 25,185 27,181 21),(181 31,187 35,185 37,181 31),(181 41,187 45,185 47,181 41),(181 51,187 55,185 57,181 51),(181 6
1,187 65,185 67,181 61),(181 71,187 75,185 77,181 71),(181 81,187 85,185 87,181 81),(181 91,187 95,185 97,181 91),(181 101,187 105,185 107,181 101),(181 111,187 115,185 117,181 111),(181 121,187 125,185 127,181 121),(181 131,187 135,185 137,181 131),(181 141,187 145,185 147,181 141),(181 151,187 155,185 157,181 151),(181 161,187 165,185 167,181 161),(181 171,187 175,185 177,181 171),(181 181,187 185,185 187,181 181),(191 1,197 5,195 7,191 1),(191 11,197 15,195 17,191 11),(191 21,197 25,195 27,191 21),(191 31,197 35,195 37,191 31),(191 41,197 45,195 47,191 41),(191 51,197 55,195 57,191 51),(191 61,197 65,195 67,191 61),(191 71,197 75,195 77,191 71),(191 81,197 85,195 87,191 81),(191 91,197 95,195 97,191 91),(191 101,197 105,195 107,191 101),(191 111,197 115,195 117,191 111),(191 121,197 125,195 127,191 121),(191 131,197 135,195 137,191 131),(191 141,197 145,195 147,191 141),(191 151,197 155,195 157,191 151),(191 161,197 165,195 167,191 161),(191 171,197 175,195 177,191 171),(191 181,197 185,195 187,191 181))"
,
+ 1144, "", "",
+ 764, "", "", true);
+
+
+ test_sectionalize<boost::geometry::linestring<P> >(
+ "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", "+|.");
+
+ test_sectionalize<boost::geometry::polygon<P> >(
+ "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", ".|+|-");
+
+ test_sectionalize<boost::geometry::polygon<P> >
+ ("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<boost::geometry::polygon<P> >(
+ "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<boost::geometry::polygon<P> >(
+ "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<boost::geometry::linestring<P> >(
+ "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<boost::geometry::linestring<P> >(
+ "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 boost::geometry::box<P> B;
+ test_sectionalize<2, B>(boost::geometry::make<B>(0,0,4,4),
+ 4, "0..1|1..2|2..3|3..4", ". +|+ .|. -|- .");
+ test_sectionalize<1, B>(boost::geometry::make<B>(0,0,4,4),
+ 4, "0..1|1..2|2..3|3..4", ".|+|.|-");
+}
+
+int test_main(int, char* [])
+{
+ //test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/sectionalize.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/sectionalize.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="sectionalize"
+ ProjectGUID="{50410F81-7B83-49D9-BDAE-FA3F0ADB2ADC}"
+ RootNamespace="sectionalize"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\sectionalize"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\sectionalize"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\sectionalize.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/simplify.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/simplify.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,86 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iterator>
+
+
+#include <algorithms/test_simplify.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+
+#include <test_common/test_point.hpp>
+
+
+
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::linestring<P> >(
+ "LINESTRING(0 0,5 5,10 10)",
+ "LINESTRING(0 0,10 10)", 1.0);
+
+ test_geometry<boost::geometry::linestring<P> >(
+ "LINESTRING(0 0, 5 5, 6 5, 10 10)",
+ "LINESTRING(0 0,10 10)", 1.0);
+
+ test_geometry<boost::geometry::linestring<P> >(
+ "LINESTRING(0 0,5 5,7 5,10 10)",
+ "LINESTRING(0 0,5 5,7 5,10 10)", 1.0);
+
+ test_geometry<boost::geometry::polygon<P> >(
+ "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<boost::geometry::polygon<P> >(
+ "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);
+
+/*
+
+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))
+union all select astext(ST_Simplify(geomfromtext('LINESTRING(0 0, 5 5, 7 5, 10 10)'),1.0))
+union all select astext(ST_Simplify(geomfromtext('POLYGON((4 0, 8 2, 8 7, 4 9, 0 7, 0 2, 2 1, 4 0))'),1.0))
+union all select astext(ST_Simplify(geomfromtext('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))'),1.0))
+*/
+
+ // Just check compilation
+ test_geometry<P>(
+ "POINT(0 0)",
+ "POINT(0 0)", 1.0);
+
+
+ test_geometry<boost::geometry::linear_ring<P> >(
+ "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);
+}
+
+
+template <typename P>
+void test_spherical()
+{
+ test_geometry<boost::geometry::linestring<P> >(
+ "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<boost::geometry::point_xy<int> >();
+ //test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+ test_spherical<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/simplify.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/simplify.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="simplify"
+ ProjectGUID="{B1760CB8-553B-42AB-B54E-3D0320FF252F}"
+ RootNamespace="simplify"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\simplify"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\simplify"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\simplify.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/test_area.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_area.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,65 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_AREA_HPP
+#define BOOST_GEOMETRY_TEST_AREA_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template <typename Geometry>
+void test_area(Geometry const& geometry, long double expected_area)
+{
+ long double area = boost::geometry::area(geometry);
+
+#ifdef GGL_TEST_DEBUG
+ std::ostringstream out;
+ out << typeid(typename boost::geometry::coordinate_type<Geometry>::type).name()
+ << " "
+ << typeid(typename boost::geometry::area_result<Geometry>::type).name()
+ << " "
+ << "area : " << boost::geometry::area(geometry)
+ << std::endl;
+ std::cout << out.str();
+#endif
+
+ BOOST_CHECK_CLOSE(area, expected_area, 0.0001);
+
+ // Test with explicitly defined strategies
+ boost::geometry::strategy::area::by_triangles
+ <
+ typename boost::geometry::point_type<Geometry>::type
+ > strategy1;
+
+ area = boost::geometry::area(geometry, strategy1);
+
+ boost::geometry::strategy::area::by_triangles
+ <
+ typename boost::geometry::point_type<Geometry>::type,
+ long double
+ > strategy2;
+
+ area = boost::geometry::area(geometry, strategy2);
+
+}
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt, double expected_area)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ test_area(geometry, expected_area);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_centroid.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_centroid.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,95 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_CENTROID_HPP
+#define BOOST_GEOMETRY_TEST_CENTROID_HPP
+
+// Test-functionality, shared between single and multi tests
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/algorithms/centroid.hpp>
+#include <boost/geometry/algorithms/distance.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template<std::size_t D>
+struct check_result
+{
+};
+
+template <>
+struct check_result<2>
+{
+ template <typename Point, typename T>
+ static void apply(Point const& p, T const& x, T const& y, T const&)
+ {
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(p)), double(x), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(p)), double(y), 0.001);
+ }
+};
+
+
+template <>
+struct check_result<3>
+{
+ template <typename Point, typename T>
+ static void apply(Point const& p, T const& x, T const& y, T const& z)
+ {
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(p)), double(x), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(p)), double(y), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<2>(p)), double(z), 0.001);
+ }
+};
+
+
+
+template <typename CalculationType, typename Geometry, typename Point>
+void test_with_other_calculation_type(Geometry const& geometry, Point& c1)
+{
+ typedef typename boost::geometry::point_type<Geometry>::type point_type;
+ // Calculate it with user defined strategy
+ point_type c2;
+ boost::geometry::centroid(geometry, c2,
+ boost::geometry::strategy::centroid_::bashein_detmer<point_type, point_type, CalculationType>());
+
+ std::cout << typeid(CalculationType).name() << ": " << std::setprecision(20)
+ << boost::geometry::get<0>(c2) << " " << boost::geometry::get<1>(c2)
+ << " -> difference: " << boost::geometry::distance(c1, c2)
+ << std::endl;
+}
+
+template <typename Geometry, typename T>
+void test_centroid(std::string const& wkt, T const& x, T const& y, T const& z = T())
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ typedef typename boost::geometry::point_type<Geometry>::type point_type;
+ point_type c1;
+ boost::geometry::centroid(geometry, c1);
+ check_result<boost::geometry::dimension<Geometry>::type::value>::apply(c1, x, y, z);
+
+#ifdef REPORT_RESULTS
+ std::cout << "normal: " << std::setprecision(20) << boost::geometry::get<0>(c1) << " " << boost::geometry::get<1>(c1) << std::endl;
+
+ //test_with_other_calculation_type<long long>(geometry, c1);
+ test_with_other_calculation_type<float>(geometry, c1);
+ test_with_other_calculation_type<long double>(geometry, c1);
+#if defined(HAVE_GMP)
+ test_with_other_calculation_type<boost::numeric_adaptor::gmp_value_type>(geometry, c1);
+#endif
+#if defined(HAVE_CLN)
+ test_with_other_calculation_type<boost::numeric_adaptor::cln_value_type>(geometry, c1);
+#endif
+
+#endif
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_combine.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_combine.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,55 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_COMBINE_HPP
+#define BOOST_GEOMETRY_TEST_COMBINE_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/combine.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/util/write_dsv.hpp>
+
+
+template <typename Geometry, typename Box>
+void test_combine(Box& box,
+ std::string const& wkt,
+ std::string const& expected)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+
+ boost::geometry::combine(box, geometry);
+
+ std::ostringstream out;
+ out << boost::geometry::dsv(box, ",", "(", ")", ",", "", "");
+
+ BOOST_CHECK_EQUAL(out.str(), expected);
+}
+
+template <typename Geometry, typename Box>
+void test_combine_other_strategy(Box& box,
+ std::string const& wkt,
+ std::string const& expected)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+
+
+ boost::geometry::combine(box, geometry);
+
+ std::ostringstream out;
+ out << boost::geometry::dsv(box, ",", "(", ")", ",", "", "");
+
+ BOOST_CHECK_EQUAL(out.str(), expected);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_convex_hull.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_convex_hull.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,113 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_CONVEX_HULL_HPP
+#define BOOST_GEOMETRY_TEST_CONVEX_HULL_HPP
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/convex_hull.hpp>
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+#include <boost/geometry/geometries/polygon.hpp>
+
+
+template <typename Geometry, typename Hull>
+void test_convex_hull(Geometry const& geometry, Hull const& hull,
+ std::size_t size_original, std::size_t size_hull,
+ double expected_area, bool reverse)
+{
+
+ std::size_t n = boost::geometry::num_points(hull);
+
+ BOOST_CHECK_MESSAGE(n == size_hull,
+ "convex hull: " << boost::geometry::wkt(geometry)
+ << " -> " << boost::geometry::wkt(hull)
+ << " type "
+ << (typeid(typename boost::geometry::coordinate_type<Hull>::type).name())
+ << " -> Expected: " << size_hull
+ << " detected: " << n);
+
+
+ BOOST_CHECK(boost::geometry::num_points(geometry) == size_original);
+
+ double ah = boost::geometry::area(hull);
+ if (reverse)
+ {
+ ah = -ah;
+ }
+
+//std::cout << "Area: " << boost::geometry::area(geometry) << std::endl;
+//std::cout << boost::geometry::wkt(hull) << std::endl;
+
+ BOOST_CHECK_CLOSE(ah, expected_area, 0.001);
+}
+
+template <typename Geometry, bool Clockwise>
+void test_geometry_order(std::string const& wkt,
+ std::size_t size_original, std::size_t size_hull,
+ double expected_area)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+
+ boost::geometry::polygon
+ <
+ typename boost::geometry::point_type<Geometry>::type,
+ std::vector,
+ std::vector,
+ Clockwise
+ > hull;
+
+ // Test version with output iterator
+ convex_hull_inserter(geometry, std::back_inserter(hull.outer()));
+ test_convex_hull(geometry, hull,
+ size_original, size_hull, expected_area, ! Clockwise);
+
+ // Test version with ring as output
+ boost::geometry::clear(hull);
+ boost::geometry::convex_hull(geometry, hull.outer());
+ test_convex_hull(geometry, hull, size_original, size_hull, expected_area, false);
+
+ // Test version with polygon as output
+ boost::geometry::clear(hull);
+ boost::geometry::convex_hull(geometry, hull);
+ test_convex_hull(geometry, hull, size_original, size_hull, expected_area, false);
+
+ // Test version with strategy
+ boost::geometry::clear(hull);
+ boost::geometry::strategy::convex_hull::graham_andrew
+ <
+ Geometry,
+ typename boost::geometry::point_type<Geometry>::type
+ > graham;
+ boost::geometry::convex_hull(geometry, hull.outer(), graham);
+ test_convex_hull(geometry, hull, size_original, size_hull, expected_area, false);
+
+ // Test version with output iterator and strategy
+ boost::geometry::clear(hull);
+ boost::geometry::convex_hull_inserter(geometry, std::back_inserter(hull.outer()), graham);
+ test_convex_hull(geometry, hull, size_original, size_hull, expected_area, ! Clockwise);
+}
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt,
+ std::size_t size_original, std::size_t size_hull,
+ double expected_area)
+{
+ test_geometry_order<Geometry, true>(wkt, size_original, size_hull, expected_area);
+ test_geometry_order<Geometry, false>(wkt, size_original, size_hull, expected_area);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_envelope.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_envelope.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,88 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_ENVELOPE_HPP
+#define BOOST_GEOMETRY_TEST_ENVELOPE_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/envelope.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template<std::size_t DimensionCount>
+struct check_result
+{};
+
+template <>
+struct check_result<2>
+{
+ template <typename Box, typename T>
+ static void apply(Box const& b, const T& x1, const T& y1, const T& z1,
+ const T& x2, const T& y2, const T& z2)
+ {
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::min_corner, 0>(b)), double(x1), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::min_corner, 1>(b)), double(y1), 0.001);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::max_corner, 0>(b)), double(x2), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::max_corner, 1>(b)), double(y2), 0.001);
+ }
+};
+
+template <>
+struct check_result<3>
+{
+ template <typename Box, typename T>
+ static void apply(Box const& b, const T& x1, const T& y1, const T& z1,
+ const T& x2, const T& y2, const T& z2)
+ {
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::min_corner, 0>(b)), double(x1), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::min_corner, 1>(b)), double(y1), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::min_corner, 2>(b)), double(z1), 0.001);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::max_corner, 0>(b)), double(x2), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::max_corner, 1>(b)), double(y2), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<boost::geometry::max_corner, 2>(b)), double(z2), 0.001);
+ }
+};
+
+
+template <typename Geometry, typename T>
+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)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ boost::geometry::box<typename boost::geometry::point_type<Geometry>::type > b;
+ boost::geometry::envelope(geometry, b);
+
+ check_result<boost::geometry::dimension<Geometry>::type::value>::apply(b, x1, y1, z1, x2, y2, z2);
+}
+
+template <typename Geometry, typename T>
+void test_envelope_strategy(std::string const& wkt,
+ const T& x1, const T& x2,
+ const T& y1, const T& y2,
+ const T& z1 = 0, const T& z2 = 0)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ boost::geometry::box<typename boost::geometry::point_type<Geometry>::type > b;
+ boost::geometry::envelope(geometry, b);
+
+ check_result<boost::geometry::dimension<Geometry>::type::value>::apply(b, x1, y1, z1, x2, y2, z2);
+}
+
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_equals.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_equals.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,44 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_EQUALS_HPP
+#define BOOST_GEOMETRY_TEST_EQUALS_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/core/ring_type.hpp>
+#include <boost/geometry/algorithms/equals.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template <typename Geometry1, typename Geometry2>
+void test_geometry(std::string const& caseid,
+ std::string const& wkt1,
+ std::string const& wkt2, bool expected)
+{
+ //std::cout << caseid << " expected: " << int(expected) << std::endl;
+ //std::cout << wkt1 << std::endl;
+ Geometry1 geometry1;
+ Geometry2 geometry2;
+
+ boost::geometry::read_wkt(wkt1, geometry1);
+ boost::geometry::read_wkt(wkt2, geometry2);
+
+ bool detected = boost::geometry::equals(geometry1, geometry2);
+
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "case: " << caseid
+ << " equals: " << wkt1
+ << " to " << wkt2
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+}
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_for_each.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_for_each.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,216 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_FOR_EACH_HPP
+#define BOOST_GEOMETRY_TEST_FOR_EACH_HPP
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/for_each.hpp>
+
+#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+#include <boost/geometry/util/write_dsv.hpp>
+
+
+template<typename Point>
+inline void translate_x_function(Point& p)
+{
+ boost::geometry::set<0>(p, boost::geometry::get<0>(p) + 100.0);
+}
+
+template<typename Point>
+struct scale_y_functor
+{
+ inline void operator()(Point& p)
+ {
+ boost::geometry::set<1>(p, boost::geometry::get<1>(p) * 100.0);
+ }
+};
+
+template<typename Point>
+struct sum_x_functor
+{
+ int sum;
+
+ sum_x_functor()
+ : sum(0)
+ {}
+
+ inline void operator()(Point const& p)
+ {
+ sum += int(boost::geometry::get<0>(p));
+ }
+};
+
+// Per segment
+static std::ostringstream g_out;
+
+template<typename Segment>
+inline void stream_segment(Segment const& s)
+{
+ g_out << boost::geometry::dsv(s) << " ";
+}
+
+template<typename Segment>
+struct sum_segment_length
+{
+ double sum;
+
+ sum_segment_length()
+ : sum(0)
+ {}
+ inline void operator()(Segment const& s)
+ {
+ sum += boost::geometry::distance(s.first, s.second);
+ }
+};
+
+template<typename Segment>
+inline void modify_segment(Segment& s)
+{
+ if (boost::geometry::math::equals(boost::geometry::get<0,0>(s), 1.0))
+ {
+ boost::geometry::set<0,0>(s, 10.0);
+ }
+}
+
+
+template <typename Geometry>
+void test_per_point_const(Geometry const& geometry, int expected)
+{
+ typedef typename boost::geometry::point_type<Geometry>::type point_type;
+
+ sum_x_functor<point_type> functor;
+ functor = boost::geometry::for_each_point(geometry, functor);
+ BOOST_CHECK_EQUAL(functor.sum, expected);
+}
+
+template <typename Geometry>
+void test_per_point_non_const(Geometry& geometry,
+ std::string const& expected1,
+ std::string const& expected2)
+{
+ typedef typename boost::geometry::point_type<Geometry>::type point_type;
+
+ // function
+ boost::geometry::for_each_point(geometry, translate_x_function<point_type>);
+ std::ostringstream out1;
+ out1 << boost::geometry::wkt(geometry);
+
+ BOOST_CHECK_MESSAGE(out1.str() == expected1,
+ "for_each_point: "
+ << " expected " << expected1
+ << " got " << boost::geometry::wkt(geometry));
+
+ // functor
+ boost::geometry::for_each_point(geometry, scale_y_functor<point_type>());
+
+ std::ostringstream out2;
+ out2 << boost::geometry::wkt(geometry);
+
+ BOOST_CHECK_MESSAGE(out2.str() == expected2,
+ "for_each_point: "
+ << " expected " << expected2
+ << " got " << boost::geometry::wkt(geometry));
+}
+
+
+template <typename Geometry>
+void test_per_point(std::string const& wkt
+ , int expected_sum_x
+ , std::string const& expected1
+ , std::string const& expected2
+ )
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ test_per_point_const(geometry, expected_sum_x);
+ test_per_point_non_const(geometry, expected1, expected2);
+}
+
+
+
+template <typename Geometry>
+void test_per_segment_const(Geometry const& geometry,
+ std::string const& expected_dsv,
+ double expected_length)
+{
+ typedef typename boost::geometry::point_type<Geometry>::type point_type;
+
+ // function
+ g_out.str("");
+ g_out.clear();
+ boost::geometry::for_each_segment(geometry,
+ stream_segment<boost::geometry::segment<const point_type> >);
+ std::string out = g_out.str();
+ boost::trim(out);
+ BOOST_CHECK_EQUAL(out, expected_dsv);
+
+ // functor
+ sum_segment_length<boost::geometry::segment<const point_type> > functor;
+ functor = boost::geometry::for_each_segment(geometry, functor);
+
+ BOOST_CHECK_EQUAL(functor.sum, expected_length);
+}
+
+
+template <typename Geometry>
+void test_per_segment_non_const(Geometry& geometry,
+ std::string const& expected_wkt)
+{
+ typedef typename boost::geometry::point_type<Geometry>::type point_type;
+
+ // function
+ boost::geometry::for_each_segment(geometry,
+ modify_segment<boost::geometry::segment<point_type> >);
+
+ std::ostringstream out;
+ out << boost::geometry::wkt(geometry);
+
+ BOOST_CHECK_MESSAGE(out.str() == expected_wkt,
+ "for_each_segment: "
+ << " expected " << expected_wkt
+ << " got " << boost::geometry::wkt(geometry));
+
+ // function is working here, functor works for all others,
+ // it will also work here.
+}
+
+
+template <typename Geometry>
+void test_per_segment(std::string const& wkt
+ , std::string const& expected_dsv
+ , double expected_length
+ , std::string const& expected_wkt
+ )
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ test_per_segment_const(geometry, expected_dsv, expected_length);
+ test_per_segment_non_const(geometry, expected_wkt);
+}
+
+
+
+template <typename Geometry>
+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<Geometry>(wkt, expected_sum_x, expected1, expected2);
+ test_per_segment<Geometry>(wkt, expected_dsv, expected_length, expected_wkt);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_intersection.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,174 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_INTERSECTION_HPP
+#define BOOST_GEOMETRY_TEST_INTERSECTION_HPP
+
+#include <fstream>
+#include <iomanip>
+
+#include <boost/foreach.hpp>
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/intersection.hpp>
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/length.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+#include <boost/geometry/algorithms/unique.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+
+
+
+template <typename OutputType, typename CalculationType, typename G1, typename G2>
+double test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2,
+ int expected_count = 0, int expected_point_count = 0,
+ double expected_length_or_area = 0,
+ double percentage = 0.0001,
+ bool make_unique = true)
+{
+ static const bool is_line = boost::geometry::geometry_id<OutputType>::type::value == 2;
+
+ std::vector<OutputType> clip;
+
+ typedef typename boost::geometry::coordinate_type<G1>::type coordinate_type;
+ typedef typename boost::geometry::point_type<G1>::type point_type;
+
+ typedef boost::geometry::strategy_intersection
+ <
+ typename boost::geometry::cs_tag<point_type>::type,
+ G1,
+ G2,
+ point_type,
+ CalculationType
+ > strategy;
+
+ boost::geometry::intersection_inserter<OutputType>(g1, g2, std::back_inserter(clip), strategy());
+
+ double length_or_area = 0;
+ std::size_t n = 0;
+ for (typename std::vector<OutputType>::iterator it = clip.begin();
+ it != clip.end();
+ ++it)
+ {
+ if (expected_point_count > 0)
+ {
+ if (make_unique)
+ {
+ // Get a correct point-count without duplicate points
+ // (note that overlay might be adapted to avoid duplicates)
+ boost::geometry::unique(*it);
+ n += boost::geometry::num_points(*it);
+ }
+ else
+ {
+ n += boost::geometry::num_points(*it);
+ }
+ }
+
+ // instead of specialization we check it run-time here
+ length_or_area += is_line
+ ? boost::geometry::length(*it)
+ : boost::geometry::area(*it);
+
+ /*
+ std::cout << std::endl << "case " << caseid << " ";
+ std::cout
+ << std::setprecision(20)
+ << boost::geometry::dsv(*it) << std::endl;
+ */
+ }
+
+
+#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
+ if (expected_point_count > 0)
+ {
+ BOOST_CHECK_MESSAGE(int(n) == expected_point_count,
+ "intersection: " << caseid
+ << " #points expected: " << expected_point_count
+ << " detected: " << n
+ << " type: " << string_from_type<coordinate_type>::name()
+ );
+ }
+
+ if (expected_count > 0)
+ {
+ BOOST_CHECK_MESSAGE(int(clip.size()) == expected_count,
+ "intersection: " << caseid
+ << " #outputs expected: " << expected_count
+ << " detected: " << clip.size()
+ << " type: " << string_from_type<coordinate_type>::name()
+ );
+ }
+
+ BOOST_CHECK_CLOSE(length_or_area, expected_length_or_area, percentage);
+#endif
+
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "intersection_"
+ << caseid << "_"
+ << string_from_type<coordinate_type>::name()
+ << string_from_type<CalculationType>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<point_type> mapper(svg, 500, 500);
+
+ mapper.add(g1);
+ mapper.add(g2);
+
+ mapper.map(g1, 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:1");
+ mapper.map(g2, "opacity:0.6;fill:rgb(0,255,0);stroke:rgb(0,0,0);stroke-width:1");
+
+ for (typename std::vector<OutputType>::const_iterator it = clip.begin();
+ it != clip.end(); ++it)
+ {
+ mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5");
+ }
+ }
+#endif
+
+ return length_or_area;
+}
+
+template <typename OutputType, typename G1, typename G2>
+double test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2,
+ int expected_count = 0, int expected_point_count = 0,
+ double expected_length_or_area = 0,
+ double percentage = 0.0001,
+ bool make_unique = true)
+{
+ G1 g1;
+ boost::geometry::read_wkt(wkt1, g1);
+
+ G2 g2;
+ boost::geometry::read_wkt(wkt2, g2);
+
+ return test_intersection<OutputType, void>(caseid, g1, g2,
+ expected_count, expected_point_count,
+ expected_length_or_area, percentage, make_unique);
+}
+
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_intersects.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_intersects.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,60 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_INTERSECTS_HPP
+#define BOOST_GEOMETRY_TEST_INTERSECTS_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/core/ring_type.hpp>
+#include <boost/geometry/algorithms/intersects.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template <typename Geometry1, typename Geometry2>
+void test_geometry(std::string const& wkt1,
+ std::string const& wkt2, bool expected)
+{
+ Geometry1 geometry1;
+ Geometry2 geometry2;
+
+ boost::geometry::read_wkt(wkt1, geometry1);
+ boost::geometry::read_wkt(wkt2, geometry2);
+
+ bool detected = boost::geometry::intersects(geometry1, geometry2);
+
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "intersects: " << wkt1
+ << " with " << wkt2
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+}
+
+
+template <typename Geometry>
+void test_self_intersects(std::string const& wkt, bool expected)
+{
+ Geometry geometry;
+
+ boost::geometry::read_wkt(wkt, geometry);
+
+ bool detected = boost::geometry::intersects(geometry);
+
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "intersects: " << wkt
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+}
+
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_length.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_length.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,47 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_LENGTH_HPP
+#define BOOST_GEOMETRY_TEST_LENGTH_HPP
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/length.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+
+template <typename Geometry>
+void test_length(Geometry const& geometry, long double expected_length)
+{
+ long double length = boost::geometry::length(geometry);
+
+#ifdef GGL_TEST_DEBUG
+ std::ostringstream out;
+ out << typeid(typename boost::geometry::coordinate_type<Geometry>::type).name()
+ << std::endl
+ << typeid(typename boost::geometry::length_result<Geometry>::type).name()
+ << std::endl
+ << "length : " << boost::geometry::length(geometry)
+ << std::endl;
+ std::cout << out.str();
+#endif
+
+ BOOST_CHECK_CLOSE(length, expected_length, 0.0001);
+}
+
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt, double expected_length)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ test_length(geometry, expected_length);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_overlaps.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_overlaps.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,43 @@
+// Generic Geometry2 Library test file
+//
+// Copyright Barend Gehrels, 1995-2009, Geodan Holding B.V. 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_OVERLAPS_HPP
+#define BOOST_GEOMETRY_TEST_OVERLAPS_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/core/ring_type.hpp>
+#include <boost/geometry/algorithms/overlaps.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template <typename Geometry1, typename Geometry2>
+void test_geometry(std::string const& wkt1,
+ std::string const& wkt2, bool expected)
+{
+ Geometry1 geometry1;
+ Geometry2 geometry2;
+
+ boost::geometry::read_wkt(wkt1, geometry1);
+ boost::geometry::read_wkt(wkt2, geometry2);
+
+ bool detected = boost::geometry::overlaps(geometry1, geometry2);
+
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "overlaps: " << wkt1
+ << " with " << wkt2
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_overlay.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_overlay.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,167 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_OVERLAY_HPP
+#define BOOST_GEOMETRY_TEST_OVERLAY_HPP
+
+#include <string>
+
+static std::string example_box = "box(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))";
+
+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_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 identical[2] =
+ {"POLYGON((0 0,0 1,1 1,1 0,0 0))",
+ "POLYGON((1 1,1 0,0 0,0 1,1 1))"};
+
+
+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 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))"};
+
+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))"};
+
+
+ // First within second
+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))"};
+
+
+ // First within hole of second
+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))"};
+
+
+// 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 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 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 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))"};
+
+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))"};
+
+// case 2102 from "algorithms/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 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_15 =
+ "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))";
+static std::string comb_15 =
+ "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 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 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))"};
+
+// == 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))"};
+
+// == 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
+ };
+
+
+
+// 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 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))"};
+
+
+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.06988934
4709196 -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))"
+ };
+
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_perimeter.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_perimeter.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,50 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_PERIMETER_HPP
+#define BOOST_GEOMETRY_TEST_PERIMETER_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/perimeter.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template <typename Geometry>
+void test_perimeter(Geometry const& geometry, long double expected_perimeter)
+{
+ long double perimeter = boost::geometry::perimeter(geometry);
+
+#ifdef GGL_TEST_DEBUG
+ std::ostringstream out;
+ out << typeid(typename boost::geometry::coordinate_type<Geometry>::type).name()
+ << std::endl
+ << typeid(typename boost::geometry::perimeter_result<Geometry>::type).name()
+ << std::endl
+ << "perimeter : " << boost::geometry::perimeter(geometry)
+ << std::endl;
+ std::cout << out.str();
+#endif
+
+ BOOST_CHECK_CLOSE(perimeter, expected_perimeter, 0.0001);
+}
+
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt, double expected_perimeter)
+{
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ test_perimeter(geometry, expected_perimeter);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_relate.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_relate.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,32 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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_RELATE_HPP
+#define BOOST_GEOMETRY_TEST_RELATE_HPP
+
+#include <string>
+
+
+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

Added: sandbox/geometry/libs/geometry/test/algorithms/test_simplify.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_simplify.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,95 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_SIMPLIFY_HPP
+#define BOOST_GEOMETRY_TEST_SIMPLIFY_HPP
+
+// Test-functionality, shared between single and multi tests
+
+#include <ggl_test_common.hpp>
+#include <boost/geometry/algorithms/simplify.hpp>
+#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+template <typename Tag, typename Geometry>
+struct test_inserter
+{
+ static void apply(Geometry& , std::string const& , double )
+ {}
+};
+
+template <typename Geometry>
+struct test_inserter<boost::geometry::linestring_tag, Geometry>
+{
+ static void apply(Geometry& geometry, std::string const& expected, double distance)
+ {
+ Geometry simplified;
+ boost::geometry::simplify_inserter(geometry,
+ std::back_inserter(simplified), distance);
+
+ std::ostringstream out;
+ out << boost::geometry::wkt(simplified);
+ BOOST_CHECK_EQUAL(out.str(), expected);
+ }
+};
+
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt, std::string const& expected, double distance)
+{
+ Geometry geometry, simplified;
+
+ // Generate polygon using only integer coordinates and obvious results
+ // Polygon is a hexagon, having one extra point (2,1) on a line which should be filtered out.
+ boost::geometry::read_wkt(wkt, geometry);
+ boost::geometry::simplify(geometry, simplified, distance);
+
+ {
+ std::ostringstream out;
+ out << boost::geometry::wkt(simplified);
+
+ BOOST_CHECK_MESSAGE(out.str() == expected,
+ "simplify: " << boost::geometry::wkt(geometry)
+ << " expected " << expected
+ << " got " << boost::geometry::wkt(simplified));
+ }
+
+ // Check using user-specified strategy
+ typedef typename boost::geometry::point_type<Geometry>::type point_type;
+ typedef typename boost::geometry::cs_tag<point_type>::type tag;
+ typedef boost::geometry::strategy::distance::projected_point
+ <
+ point_type,
+ point_type
+ > strategy;
+ typedef boost::geometry::strategy::simplify::douglas_peucker
+ <
+ point_type,
+ strategy
+ > simplify_strategy_type;
+
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::SimplifyStrategy<simplify_strategy_type>) );
+ boost::geometry::simplify(geometry, simplified, distance, simplify_strategy_type());
+
+ {
+ std::ostringstream out;
+ out << boost::geometry::wkt(simplified);
+ BOOST_CHECK_EQUAL(out.str(), expected);
+ }
+
+ // Check inserter (if applicable)
+ test_inserter
+ <
+ typename boost::geometry::tag<Geometry>::type,
+ Geometry
+ >::apply(geometry, expected, distance);
+}
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,128 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_UNION_HPP
+#define BOOST_GEOMETRY_TEST_UNION_HPP
+
+#include <fstream>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/union.hpp>
+
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/length.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+#include <boost/geometry/algorithms/unique.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+
+
+template <typename OutputType, typename G1, typename G2>
+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,
+ double percentage)
+{
+ typedef typename boost::geometry::coordinate_type<G1>::type coordinate_type;
+ std::vector<OutputType> clip;
+ boost::geometry::union_inserter<OutputType>(g1, g2, std::back_inserter(clip));
+
+ double area = 0;
+ int n = 0;
+ int holes = 0;
+ for (typename std::vector<OutputType>::iterator it = clip.begin();
+ it != clip.end(); ++it)
+ {
+ area += boost::geometry::area(*it);
+ holes += boost::geometry::num_interior_rings(*it);
+
+ // Get a correct point-count without duplicate points
+ // (note that overlay might be adapted to avoid duplicates)
+ OutputType simplified;
+ boost::geometry::unique(*it);
+ n += boost::geometry::num_points(*it);
+ }
+
+
+ /***
+ std::cout << "case: " << caseid
+ << " n: " << n
+ << " area: " << area
+ << " polygons: " << boost::size(clip)
+ << " holes: " << holes
+ << std::endl;
+ ***/
+
+ BOOST_CHECK_MESSAGE(int(n) == expected_point_count,
+ "union: " << caseid
+ << " #points expected: " << expected_point_count
+ << " detected: " << n
+ << " type: " << string_from_type<coordinate_type>::name()
+ );
+
+
+ BOOST_CHECK_EQUAL(clip.size(), expected_count);
+ BOOST_CHECK_EQUAL(holes, expected_hole_count);
+ BOOST_CHECK_CLOSE(area, expected_area, percentage);
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename << "union_"
+ << caseid << "_"
+ << string_from_type<coordinate_type>::name()
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ svg_mapper<typename boost::geometry::point_type<G2>::type> mapper(svg, 500, 500);
+ mapper.add(g1);
+ mapper.add(g2);
+
+ 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 std::vector<OutputType>::const_iterator it = clip.begin();
+ it != clip.end(); ++it)
+ {
+ mapper.map(*it, "opacity:0.6;fill:none;stroke:rgb(255,0,0);stroke-width:5");
+ }
+ }
+#endif
+}
+
+template <typename OutputType, typename G1, typename G2>
+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,
+ double percentage = 0.001)
+{
+ G1 g1;
+ boost::geometry::read_wkt(wkt1, g1);
+
+ G2 g2;
+ boost::geometry::read_wkt(wkt2, g2);
+
+ test_union<OutputType>(caseid, g1, g2,
+ expected_count, expected_hole_count, expected_point_count,
+ expected_area, percentage);
+}
+
+
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/test_within.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_within.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,103 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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_WITHIN_HPP
+#define BOOST_GEOMETRY_TEST_WITHIN_HPP
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/core/ring_type.hpp>
+#include <boost/geometry/algorithms/within.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template <typename Geometry1, typename Geometry2>
+void test_geometry(std::string const& wkt1,
+ std::string const& wkt2, bool expected)
+{
+ Geometry1 geometry1;
+ Geometry2 geometry2;
+
+ boost::geometry::read_wkt(wkt1, geometry1);
+ boost::geometry::read_wkt(wkt2, geometry2);
+
+ bool detected = boost::geometry::within(geometry1, geometry2);
+
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "within: " << wkt1
+ << " in " << wkt2
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+}
+
+
+template <typename Point, bool CW>
+void test_ordered_ring(std::string const& wkt_point,
+ std::string const& wkt_geometry, bool expected, bool on_border)
+{
+ typedef boost::geometry::linear_ring<Point, std::vector, CW> ring_type;
+ ring_type ring;
+ Point point;
+
+ boost::geometry::read_wkt(wkt_geometry, ring);
+ if (! CW)
+ {
+ std::reverse(boost::begin(ring), boost::end(ring));
+ }
+ boost::geometry::read_wkt(wkt_point, point);
+
+ bool detected = boost::geometry::within(point, ring);
+
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "within: " << wkt_point
+ << " in " << wkt_geometry
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+
+ // other strategy (note that this one cannot detect OnBorder
+ // (without modifications)
+
+ boost::geometry::strategy::within::franklin<Point> franklin;
+ detected = boost::geometry::within(point, ring, franklin);
+ if (! on_border)
+ {
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "within: " << wkt_point
+ << " in " << wkt_geometry
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+ }
+
+
+ boost::geometry::strategy::within::crossings_multiply<Point> cm;
+ detected = boost::geometry::within(point, ring, cm);
+ if (! on_border)
+ {
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "within: " << wkt_point
+ << " in " << wkt_geometry
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+ }
+}
+
+template <typename Point>
+void test_ring(std::string const& wkt_point,
+ std::string const& wkt_geometry,
+ bool expected, bool on_border)
+{
+ test_ordered_ring<Point, true>(wkt_point, wkt_geometry, expected, on_border);
+ test_ordered_ring<Point, false>(wkt_point, wkt_geometry, expected, on_border);
+ test_geometry<Point, boost::geometry::polygon<Point> >(wkt_point, wkt_geometry, expected);
+}
+
+#endif

Added: sandbox/geometry/libs/geometry/test/algorithms/transform.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/transform.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,129 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <sstream>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/algorithms/transform.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/util/write_dsv.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <test_common/test_point.hpp>
+
+template <typename P1, typename P2>
+void test_transform_point(double value)
+{
+ P1 p1;
+ boost::geometry::set<0>(p1, 1);
+ boost::geometry::set<1>(p1, 2);
+ P2 p2;
+ boost::geometry::transform(p1, p2);
+
+ BOOST_CHECK_CLOSE(value * boost::geometry::get<0>(p1), double(boost::geometry::get<0>(p2)), 0.001);
+ BOOST_CHECK_CLOSE(value * boost::geometry::get<1>(p1), double(boost::geometry::get<1>(p2)), 0.001);
+}
+
+template <typename P1, typename P2>
+void test_transform_linestring()
+{
+ boost::geometry::linestring<P1> line1;
+ line1.push_back(boost::geometry::make<P1>(1, 1));
+ line1.push_back(boost::geometry::make<P1>(2, 2));
+ boost::geometry::linestring<P2> line2;
+ boost::geometry::transform(line1, line2);
+ BOOST_CHECK_EQUAL(line1.size(), line2.size());
+
+ std::ostringstream out1, out2;
+ out1 << boost::geometry::wkt(line1);
+ out2 << boost::geometry::wkt(line2);
+ BOOST_CHECK_EQUAL(out1.str(), out1.str());
+}
+
+
+template <typename P1, typename P2>
+void test_all(double value = 1.0)
+{
+ test_transform_point<P1, P2>(value);
+ test_transform_linestring<P1, P2>();
+}
+
+template <typename T, typename DegreeOrRadian>
+void test_transformations(double phi, double theta, double r)
+{
+ using namespace boost::geometry;
+
+ typedef point<T, 3, cs::cartesian> cartesian_type;
+ cartesian_type p;
+
+ // 1: using spherical coordinates
+ {
+ typedef point<T, 3, cs::spherical<DegreeOrRadian> > spherical_type;
+ spherical_type sph1;
+ assign(sph1, phi, theta, r);
+ transform(sph1, p);
+
+ spherical_type sph2;
+ transform(p, sph2);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(sph1)), double(boost::geometry::get<0>(sph2)), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(sph1)), double(boost::geometry::get<1>(sph2)), 0.001);
+
+ //std::cout << dsv(p) << std::endl;
+ //std::cout << dsv(sph2) << std::endl;
+ }
+
+ // 2: using spherical coordinates on unit sphere
+ {
+ typedef point<T, 2, cs::spherical<DegreeOrRadian> > spherical_type;
+ spherical_type sph1, sph2;
+ assign(sph1, phi, theta);
+ transform(sph1, p);
+ transform(p, sph2);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(sph1)), double(boost::geometry::get<0>(sph2)), 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(sph1)), double(boost::geometry::get<1>(sph2)), 0.001);
+
+ //std::cout << dsv(sph1) << " " << dsv(p) << " " << dsv(sph2) << std::endl;
+ }
+}
+
+int test_main(int, char* [])
+{
+ using namespace boost::geometry;
+ using namespace boost::geometry::cs;
+ using namespace boost::geometry::math;
+
+
+ typedef boost::geometry::point_xy<double > P;
+ test_all<P, P>();
+ test_all<boost::geometry::point_xy<int>, boost::geometry::point_xy<float> >();
+
+ test_all<boost::geometry::point<double, 2, spherical<degree> >,
+ boost::geometry::point<double, 2, spherical<radian> > >(d2r);
+ test_all<boost::geometry::point<double, 2, spherical<radian> >,
+ boost::geometry::point<double, 2, spherical<degree> > >(r2d);
+
+ test_all<boost::geometry::point<int, 2, spherical<degree> >,
+ boost::geometry::point<float, 2, spherical<radian> > >(d2r);
+
+ test_transformations<float, degree>(4, 52, 1);
+ test_transformations<double, degree>(4, 52, 1);
+
+ test_transformations<float, radian>(3 * d2r, 51 * d2r, 1);
+ test_transformations<double, radian>(3 * d2r, 51 * d2r, 1);
+
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/transform.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/transform.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="transform"
+ ProjectGUID="{41413E56-08DA-4592-94D2-5311FE90C62B}"
+ RootNamespace="transform"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transform"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transform"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\transform.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/union.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/union.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,254 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <string>
+
+//#define BOOST_GEOMETRY_DEBUG_ASSEMBLE
+//#define BOOST_GEOMETRY_DEBUG_IDENTIFIER
+
+
+#include <algorithms/test_union.hpp>
+#include <algorithms/test_overlay.hpp>
+
+#include <algorithms/overlay/overlay_cases.hpp>
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::polygon<P> polygon;
+ typedef boost::geometry::linear_ring<P> ring;
+ typedef boost::geometry::box<P> box;
+
+
+ test_one<polygon, box, polygon>("box_ring", example_box, example_ring,
+ 1, 1, 15, 6.38875);
+
+ test_one<polygon, box, polygon>("box_poly", example_box, example_polygon,
+ 1, 3, 23, 6.30983);
+
+ test_one<polygon, polygon, polygon>("star_ring", example_star, example_ring,
+ 1, 0, 23, 5.67017141);
+
+ test_one<polygon, polygon, polygon>("star_poly", example_star, example_polygon,
+ 1, 1, 27, 5.647949);
+
+ test_one<polygon, box, polygon>("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<polygon, box, polygon>("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);
+
+ // Same as 3, but now as polygon
+ // (note, internally, the intersection points is different, so yes,
+ // it has to be tested)
+ test_one<polygon, polygon, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("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<polygon, box, polygon>("box_poly8", "box(0 0, 3 3)",
+ "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))",
+ 1, 0, 8, 10.25);
+
+
+ // First inside second
+ test_one<polygon, polygon, polygon>("first_within_second",
+ first_within_second[0], first_within_second[1],
+ 1, 0, 5, 25.0);
+
+ // Second inside first
+ test_one<polygon, polygon, polygon>("seond_within_first",
+ first_within_second[1], first_within_second[0],
+ 1, 0, 5, 25.0);
+
+ // First inside hole of second
+ test_one<polygon, polygon, polygon>("first_within_hole_of_second",
+ first_within_hole_of_second[0], first_within_hole_of_second[1],
+ 2, 1, 15, 17.0);
+
+ // forming new hole
+ test_one<polygon, polygon, polygon>("new_hole",
+ new_hole[0], new_hole[1],
+ 1, 1, 14, 23.0);
+
+ // side by side
+ test_one<polygon, polygon, polygon>("side_side",
+ side_side[0], side_side[1], 1, 0, 7, 2.0);
+
+ // identical
+ test_one<polygon, polygon, polygon>("identical",
+ identical[0], identical[1], 1, 0, 5, 1.0);
+
+ // inside each other, having intersections; holes separate intersections
+ test_one<polygon, polygon, polygon>("intersect_holes_intersect",
+ intersect_holes_intersect[0], intersect_holes_intersect[1],
+ 1, 1, 14, 39.75);
+
+ test_one<polygon, polygon, polygon>("intersect_holes_intersect_and_disjoint",
+ intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1],
+ 1, 1, 14, 39.75);
+
+ test_one<polygon, polygon, polygon>("intersect_holes_intersect_and_touch",
+ intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1],
+ 1, 1, 14, 39.75);
+
+ test_one<polygon, polygon, polygon>("intersect_holes_new_ring",
+ intersect_holes_new_ring[0], intersect_holes_new_ring[1],
+ 1, 2, 15, 253.8961);
+
+ // inside each other, having intersections but holes are disjoint
+ test_one<polygon, polygon, polygon>("intersect_holes_disjoint",
+ intersect_holes_disjoint[0],
+ intersect_holes_disjoint[1],
+ 1, 0, 9, 40.0);
+
+ // inside each other, having no intersections but holes are disjoint
+ test_one<polygon, polygon, polygon>("within_holes_disjoint",
+ within_holes_disjoint[0], within_holes_disjoint[1],
+ 1, 0, 5, 49.0);
+
+ test_one<polygon, polygon, polygon>("winded",
+ winded[0], winded[1],
+ 1, 5, 30, 114.0);
+
+ test_one<polygon, polygon, polygon>("two_bends",
+ two_bends[0], two_bends[1],
+ 1, 0, 7, 40.0);
+
+
+ test_one<polygon, polygon, polygon>("equal_holes_disjoint",
+ equal_holes_disjoint[0], equal_holes_disjoint[1],
+ 1, 1, 10, 81 - 3 * 7);
+
+ test_one<polygon, polygon, polygon>("only_hole_intersections1",
+ only_hole_intersections[0], only_hole_intersections[1],
+ 1, 2, 13, 190.9090909);
+ test_one<polygon, polygon, polygon>("only_hole_intersections2",
+ only_hole_intersections[0], only_hole_intersections[2],
+ 1, 2, 13, 190.9090909);
+
+ test_one<polygon, polygon, polygon>("intersect_exterior_and_interiors_winded",
+ intersect_exterior_and_interiors_winded[0], intersect_exterior_and_interiors_winded[1],
+ 1, 1, 26, 66.5333333);
+
+
+ test_one<polygon, polygon, polygon>("simplex_normal",
+ simplex_normal[0], simplex_normal[1],
+ 1, 0, 13, 11.526367);
+
+ test_one<polygon, polygon, polygon>("fitting",
+ fitting[0], fitting[1],
+ 1, 0, 5, 25);
+
+ test_one<polygon, polygon, polygon>("wrapped_a",
+ wrapped[0], wrapped[1],
+ 1, 1, 16, 16);
+ test_one<polygon, polygon, polygon>("wrapped_b",
+ wrapped[0], wrapped[2],
+ 1, 1, 16, 16);
+
+
+ test_one<polygon, polygon, polygon>("9",
+ case_9[0], case_9[1], 2, 0, 8, 11);
+ test_one<polygon, polygon, polygon>("22",
+ case_22[0], case_22[1], 2, 0, 8, 9.5);
+ test_one<polygon, polygon, polygon>("25",
+ case_25[0], case_25[1], 2, 0, 8, 7);
+ test_one<polygon, polygon, polygon>("26",
+ case_26[0], case_26[1], 2, 0, 9, 7.5);
+ test_one<polygon, polygon, polygon>("31",
+ case_31[0], case_31[1], 2, 0, 8, 4.5);
+ test_one<polygon, polygon, polygon>("32",
+ case_32[0], case_32[1], 2, 0, 8, 4.5);
+ test_one<polygon, polygon, polygon>("33",
+ case_33[0], case_33[1], 2, 0, 8, 4.5);
+ test_one<polygon, polygon, polygon>("40",
+ case_40[0], case_40[1], 2, 0, 18, 11);
+
+
+ /*
+ test_one<polygon, polygon, polygon>(102,
+ simplex_normal[0], simplex_reversed[1],
+ 1, 0, 7, X);
+
+ test_one<polygon, polygon, polygon>(103,
+ simplex_reversed[0], simplex_normal[1],
+ 1, 0, 7, 24.0);
+
+ test_one<polygon, polygon, polygon>(104,
+ simplex_reversed[0], simplex_reversed[1],
+ 1, 0, 7, 24.0);
+
+ test_one<polygon, polygon, polygon>(100,
+ star_15, comb_15,
+ 1, 10, 7, 24.0);
+ */
+
+ // test some other input/output types
+
+ // 1 input ring
+ test_one<polygon, polygon, ring>("identical_pr", identical[0], identical[1], 1, 0, 5, 1.0);
+ test_one<polygon, ring, polygon>("identical_rp", identical[0], identical[1], 1, 0, 5, 1.0);
+
+ // 2 input rings
+ test_one<polygon, ring, ring>("identical_rr", identical[0], identical[1], 1, 0, 5, 1.0);
+
+ // output is also ring
+ test_one<ring, ring, ring>("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<ring, ring, ring>("new_hole_discarded", new_hole[0], new_hole[1], 1, 0, 9, 24.0);
+
+ // Isovist (submitted by Brandon during Formal Review)
+ {
+ std::string tn = string_from_type<typename boost::geometry::coordinate_type<P>::type>::name();
+ //std::cout << tn << std::endl;
+ test_one<polygon, polygon, polygon>("isovist", isovist[0], isovist[1], 1, 0,
+
+ // Note, the number of resulting points differs per point type AND
+ // per operating system (showing this test is quite demanding)
+#if defined(_MSC_VER)
+ tn == std::string("f") ? 71 : 72,
+#else
+ tn == std::string("f") ? 71 : tn == std::string("e") ? 75 : 70,
+#endif
+ 313.3603646,
+ 0.1);
+ }
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+ //test_all<boost::geometry::point_xy<long double> >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/union.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/union.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="union"
+ ProjectGUID="{CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}"
+ RootNamespace="union"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\union"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\union"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;..;../../example/contrib/gd-2.0.35"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NONDLL;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\union.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/algorithms/within.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/within.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,81 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <algorithms/test_within.hpp>
+
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/linestring.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ // trivial case
+ test_ring<P>("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true, false);
+
+ // on border/corner
+ test_ring<P>("POINT(0 0)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true);
+ test_ring<P>("POINT(0 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", false, true);
+
+ // aligned to segment/vertex
+ test_ring<P>("POINT(1 1)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", true, false);
+ test_ring<P>("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<P>("POINT(3 3)", "POLYGON((0 0,0 3,3 3,3 1,2 1,2 0,0 0))", false, true);
+ test_ring<P>("POINT(3 3)", "POLYGON((0 0,0 3,4 3,3 1,2 2,2 0,0 0))", false, true);
+
+ // holes
+ test_geometry<P, boost::geometry::polygon<P> >("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<P, boost::geometry::box<P> >("POINT(1 1)", "BOX(0 0,2 2)", true);
+
+ // Mixed point types
+ test_geometry
+ <
+ boost::geometry::point_xy<float>,
+ boost::geometry::polygon<P>
+ >("POINT(1 1)", "POLYGON((0 0,0 2,2 2,2 0,0 0))", true);
+
+
+ // Real-life problem (solved now), point is in the middle, 409623 is also a coordinate
+ // on the border, it was wrong first.
+ test_ring<P>("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);
+}
+
+
+
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/algorithms/within.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/within.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="within"
+ ProjectGUID="{C7BCD670-543D-4B29-B2D6-F3169949F79D}"
+ RootNamespace="within"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\within"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\within"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\within.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/arithmetic/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,20 @@
+# test/arithmetic/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-arithmetic
+ :
+ [ run arithmetic.cpp ]
+ [ run cross_product.cpp ]
+ [ compile-fail cross_product.cpp
+ : # requirements
+ <define>TEST_FAIL_CROSS_PRODUCT
+ : # target name
+ cross_product_compile_fail
+ ]
+ [ run dot_product.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/arithmetic/arithmetic.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/arithmetic.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,119 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/arithmetic/arithmetic.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+using namespace boost::geometry;
+
+template <typename P>
+void test_addition()
+{
+ P p1;
+ boost::geometry::assign(p1, 1, 2, 3);
+ boost::geometry::add_value(p1, 10);
+ BOOST_CHECK(get<0>(p1) == 11);
+ BOOST_CHECK(get<1>(p1) == 12);
+ BOOST_CHECK(get<2>(p1) == 13);
+
+ P p2;
+ boost::geometry::assign(p2, 4, 5, 6);
+ boost::geometry::add_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == 15);
+ BOOST_CHECK(get<1>(p1) == 17);
+ BOOST_CHECK(get<2>(p1) == 19);
+}
+
+template <typename P>
+void test_subtraction()
+{
+ P p1;
+ boost::geometry::assign(p1, 1, 2, 3);
+ boost::geometry::subtract_value(p1, 10);
+ BOOST_CHECK(get<0>(p1) == -9);
+ BOOST_CHECK(get<1>(p1) == -8);
+ BOOST_CHECK(get<2>(p1) == -7);
+
+ P p2;
+ boost::geometry::assign(p2, 4, 6, 8);
+ boost::geometry::subtract_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == -13);
+ BOOST_CHECK(get<1>(p1) == -14);
+ BOOST_CHECK(get<2>(p1) == -15);
+}
+
+template <typename P>
+void test_multiplication()
+{
+ P p1;
+ boost::geometry::assign(p1, 1, 2, 3);
+ boost::geometry::multiply_value(p1, 5);
+ BOOST_CHECK(get<0>(p1) == 5);
+ BOOST_CHECK(get<1>(p1) == 10);
+ BOOST_CHECK(get<2>(p1) == 15);
+
+ P p2;
+ boost::geometry::assign(p2, 4, 5, 6);
+ boost::geometry::multiply_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == 20);
+ BOOST_CHECK(get<1>(p1) == 50);
+ BOOST_CHECK(get<2>(p1) == 90);
+}
+
+template <typename P>
+void test_division()
+{
+ P p1;
+ boost::geometry::assign(p1, 50, 100, 150);
+ boost::geometry::divide_value(p1, 5);
+ BOOST_CHECK(get<0>(p1) == 10);
+ BOOST_CHECK(get<1>(p1) == 20);
+ BOOST_CHECK(get<2>(p1) == 30);
+
+ P p2;
+ boost::geometry::assign(p2, 2, 4, 6);
+ boost::geometry::divide_point(p1, p2);
+ BOOST_CHECK(get<0>(p1) == 5);
+ BOOST_CHECK(get<1>(p1) == 5);
+ BOOST_CHECK(get<2>(p1) == 5);
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_addition<P>();
+ test_subtraction<P>();
+ test_multiplication<P>();
+ test_division<P>();
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test::test_point>();
+ test_all<point<int, 3, boost::geometry::cs::cartesian> >();
+ test_all<point<float, 3, boost::geometry::cs::cartesian> >();
+ test_all<point<double, 3, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/arithmetic/arithmetic.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/arithmetic.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="arithmetic"
+ ProjectGUID="{4D447233-54DC-4C1B-B8DF-4689590ACF56}"
+ RootNamespace="arithmetic"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\arithmetic"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\arithmetic"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\arithmetic.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/arithmetic/arithmetic_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/arithmetic_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,31 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arithmetic", "arithmetic.vcproj", "{4D447233-54DC-4C1B-B8DF-4689590ACF56}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dot_product", "dot_product.vcproj", "{C9CD2A98-3327-4560-A979-4BF506F777A8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cross_product", "cross_product.vcproj", "{C2CD2F98-3327-4560-A979-4BF506F777A8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Debug|Win32.Build.0 = Debug|Win32
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Release|Win32.ActiveCfg = Release|Win32
+ {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Release|Win32.Build.0 = Release|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Debug|Win32.Build.0 = Debug|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Release|Win32.ActiveCfg = Release|Win32
+ {C9CD2A98-3327-4560-A979-4BF506F777A8}.Release|Win32.Build.0 = Release|Win32
+ {C2CD2F98-3327-4560-A979-4BF506F777A8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C2CD2F98-3327-4560-A979-4BF506F777A8}.Debug|Win32.Build.0 = Debug|Win32
+ {C2CD2F98-3327-4560-A979-4BF506F777A8}.Release|Win32.ActiveCfg = Release|Win32
+ {C2CD2F98-3327-4560-A979-4BF506F777A8}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/arithmetic/cross_product.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/cross_product.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,80 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright (c) 2009 Mateusz Loskot, (mateusz_at_[hidden])
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/arithmetic/cross_product.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+using namespace boost::geometry;
+
+template <typename P>
+void test_2d()
+{
+ P p1;
+ boost::geometry::assign(p1, 20, 30);
+ P p2;
+ boost::geometry::assign(p2, 45, 70);
+ P c = boost::geometry::cross_product(p1, p2);
+
+ typedef typename boost::geometry::coordinate_type<P>::type scalar_type;
+ BOOST_CHECK_EQUAL(boost::geometry::get<0>(c), scalar_type(50));
+}
+
+template <typename P>
+void test_3d()
+{
+ P p1;
+ boost::geometry::assign(p1, 20, 30, 10);
+ P p2;
+ boost::geometry::assign(p2, 45, 70, 20);
+ P c = boost::geometry::cross_product(p1, p2);
+
+ typedef typename boost::geometry::coordinate_type<P>::type scalar_type;
+ BOOST_CHECK_EQUAL(boost::geometry::get<0>(c), scalar_type(-100));
+ BOOST_CHECK_EQUAL(boost::geometry::get<1>(c), scalar_type(50));
+ BOOST_CHECK_EQUAL(boost::geometry::get<2>(c), scalar_type(50));
+}
+
+#ifdef TEST_FAIL_CROSS_PRODUCT
+template <typename P>
+void test_4d()
+{
+ P p1;
+ boost::geometry::assign(p1, 20, 30, 10, 15);
+ P p2;
+ boost::geometry::assign(p2, 45, 70, 20, 35);
+ P c = boost::geometry::cross_product(p1, p2);
+}
+#endif
+
+int test_main(int, char* [])
+{
+ test_2d<point<int, 2, boost::geometry::cs::cartesian> >();
+ test_2d<point<float, 2, boost::geometry::cs::cartesian> >();
+ test_2d<point<double, 2, boost::geometry::cs::cartesian> >();
+
+ test_3d<point<int, 3, boost::geometry::cs::cartesian> >();
+ test_3d<point<float, 3, boost::geometry::cs::cartesian> >();
+ test_3d<point<double, 3, boost::geometry::cs::cartesian> >();
+
+#ifdef TEST_FAIL_CROSS_PRODUCT
+ test_4d<point<int, 3, boost::geometry::cs::cartesian> >();
+ test_4d<point<float, 3, boost::geometry::cs::cartesian> >();
+ test_4d<point<double, 3, boost::geometry::cs::cartesian> >();
+#endif
+
+ return 0;
+}
+

Added: sandbox/geometry/libs/geometry/test/arithmetic/cross_product.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/cross_product.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="cross_product"
+ ProjectGUID="{C2CD2F98-3327-4560-A979-4BF506F777A8}"
+ RootNamespace="cross_product"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\cross_product"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\cross_product"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\cross_product.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/arithmetic/dot_product.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/dot_product.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,46 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/arithmetic/dot_product.hpp>
+
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+using namespace boost::geometry;
+
+template <typename P>
+void test_all()
+{
+ P p1;
+ boost::geometry::assign(p1, 1, 2, 3);
+ P p2;
+ boost::geometry::assign(p2, 4, 5, 6);
+ BOOST_CHECK(boost::geometry::dot_product(p1, p2) == 1*4 + 2*5 + 3*6);
+}
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test::test_point>();
+ test_all<point<int, 3, boost::geometry::cs::cartesian> >();
+ test_all<point<float, 3, boost::geometry::cs::cartesian> >();
+ test_all<point<double, 3, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/arithmetic/dot_product.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/arithmetic/dot_product.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="dot_product"
+ ProjectGUID="{C9CD2A98-3327-4560-A979-4BF506F777A8}"
+ RootNamespace="dot_product"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\dot_product"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\dot_product"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\dot_product.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/boost.vsprops
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/boost.vsprops 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="boost"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(BOOST_ROOT);..\..\.."
+ WarningLevel="3"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalLibraryDirectories="$(BOOST_ROOT)\lib"
+ />
+ <UserMacro
+ Name="BOOST_ROOT"
+ Value="C:\Program Files\boost\boost_1_41_0"
+ />
+</VisualStudioPropertySheet>

Added: sandbox/geometry/libs/geometry/test/compile_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/compile_test.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,229 @@
+// TODO: OLD!
+
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <deque>
+#include <iostream>
+#include <limits>
+#include <list>
+#include <memory>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <boost/geometry/multi/core/tags.hpp>
+#include <boost/geometry/algorithms/for_each.hpp>
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/centroid.hpp>
+#include <boost/geometry/algorithms/correct.hpp>
+#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/algorithms/envelope.hpp>
+#include <boost/geometry/algorithms/for_each.hpp>
+#include <boost/geometry/algorithms/intersection.hpp>
+#include <boost/geometry/algorithms/length.hpp>
+#include <boost/geometry/algorithms/simplify.hpp>
+#include <boost/geometry/algorithms/within.hpp>
+#include <boost/geometry/algorithms/overlaps.hpp>
+
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+template<typename P>
+struct modifying_functor
+{
+ double sum;
+ modifying_functor() : sum(0)
+ {}
+ inline void operator()(P& p)
+ {
+ p.x(1);
+ }
+
+ inline void operator()(boost::geometry::segment<P>& s)
+ {
+ s.first.x(1);
+ }
+};
+
+template<typename P>
+struct const_functor
+{
+ double sum;
+ const_functor() : sum(0)
+ {}
+ inline void operator()(P const& p)
+ {
+ sum += p.x();
+ }
+
+ inline void operator()(boost::geometry::segment<P> const& s)
+ {
+ sum += s.first.x() - s.second.x();
+ }
+};
+
+template <typename T, template<typename, typename> class V>
+void check_linestring()
+{
+ typedef boost::geometry::point_xy<T> P;
+ typedef boost::geometry::linestring<P, V, std::allocator> line_type;
+ line_type line;
+ line.push_back(P(0,0));
+ line.push_back(P(1,1));
+
+ typedef boost::geometry::multi_linestring<line_type, V, std::allocator> multi_line_type;
+ multi_line_type multi;
+ multi.push_back(line);
+
+ double len = boost::geometry::length(line);
+ len = boost::geometry::length(multi);
+ double d = boost::geometry::distance(P(0,1), line);
+ //d = boost::geometry::distance(P(0,1), multi); not defined yet!
+
+ line_type simp;
+ boost::geometry::simplify(line, simp, 3);
+ multi_line_type simpm;
+ boost::geometry::simplify(multi, simpm, 3);
+
+ typedef boost::geometry::box<P> box_type;
+ box_type box1;
+ boost::geometry::envelope(line, box1);
+ box_type box2;
+ boost::geometry::envelope(multi, box2);
+
+ // FIXME: Where is output stream op for line/multi --mloskot
+ //std::stringstream out;
+ // out << line << std::endl;
+ //out << multi << std::endl;
+
+ // For each, const
+ const_functor<P> cf;
+ std::for_each(line.begin(), line.end(), cf);
+
+ const line_type& cl = line;
+ const multi_line_type& cm = multi;
+
+ boost::geometry::for_each_point(cl, cf);
+ boost::geometry::for_each_point(cm, cf);
+ boost::geometry::for_each_segment(cl, cf);
+ boost::geometry::for_each_segment(cm, cf);
+
+ // For each, modifying
+ modifying_functor<P> mf;
+ line_type& ml = line;
+ multi_line_type& mm = multi;
+ std::for_each(line.begin(), line.end(), mf);
+ boost::geometry::for_each_point(ml, mf);
+ boost::geometry::for_each_point(mm, mf);
+ boost::geometry::for_each_segment(ml, mf);
+ boost::geometry::for_each_segment(mm, mf);
+}
+
+template
+<
+ typename T,
+ template<typename, typename> class VP,
+ template<typename, typename> class VR
+>
+void check_polygon()
+{
+ typedef boost::geometry::point_xy<T> P;
+ typedef boost::geometry::polygon<P, VP, VR, std::allocator, std::allocator> Y;
+ Y poly;
+ poly.outer().push_back(P(0,0));
+ poly.outer().push_back(P(2,0));
+ poly.outer().push_back(P(2,2));
+ poly.outer().push_back(P(0,2));
+
+ boost::geometry::correct(poly);
+
+ // multi
+ typedef boost::geometry::multi_polygon<Y, VP, std::allocator> MY;
+ MY multi;
+ multi.push_back(poly);
+
+ double a = boost::geometry::area(poly);
+ a = boost::geometry::area(multi);
+
+ //double d = boost::geometry::distance(P(0,1), poly);
+
+ Y simp;
+ boost::geometry::simplify(poly, simp, 3);
+ MY msimp;
+ boost::geometry::simplify(multi, msimp, 3);
+
+ typedef boost::geometry::box<P> box_type;
+ box_type box1;
+ boost::geometry::envelope(poly, box1);
+ box_type box2;
+ boost::geometry::envelope(multi, box2);
+
+ P ctr;
+ boost::geometry::centroid(poly, ctr);
+
+ // within
+ boost::geometry::point_2d circ_centre(10,10);
+ boost::geometry::circle circ(circ_centre, 10);
+
+ bool w = boost::geometry::within(P(1, 1), poly);
+ w = boost::geometry::within(poly, circ);
+ //w = boost::geometry::within(poly, b); tbd
+ w = boost::geometry::within(P(1, 1), multi);
+ w = boost::geometry::within(multi, circ);
+ //w = boost::geometry::within(multi, b); tbd
+
+ // For each, const
+ const_functor<P> cf;
+ std::for_each(poly.outer().begin(), poly.outer().end(), cf);
+
+ const Y& cp = poly;
+ const MY& cm = multi;
+
+ boost::geometry::for_each_point(cp, cf);
+ boost::geometry::for_each_point(cm, cf);
+ boost::geometry::for_each_segment(cp, cf);
+ boost::geometry::for_each_segment(cm, cf);
+
+ // For each, modifying
+ modifying_functor<P> mf;
+ Y& mp = poly;
+ MY& mm = multi;
+ std::for_each(poly.outer().begin(), poly.outer().end(), mf);
+ boost::geometry::for_each_point(mp, mf);
+ boost::geometry::for_each_point(mm, mf);
+ boost::geometry::for_each_segment(mp, mf);
+ boost::geometry::for_each_segment(mm, mf);
+}
+
+
+int main()
+{
+ check_linestring<double, std::vector>();
+ check_linestring<float, std::vector>();
+ check_linestring<int, std::vector>();
+ check_linestring<char, std::vector>();
+
+ check_linestring<double, std::list>();
+ check_linestring<double, std::deque>();
+
+ check_polygon<double, std::vector, std::vector>();
+ check_polygon<float, std::vector, std::vector>();
+ check_polygon<int, std::vector, std::vector>();
+ check_polygon<char, std::vector, std::vector>();
+
+ check_polygon<double, std::list, std::vector>();
+ check_polygon<double, std::deque, std::vector>();
+ check_polygon<double, std::list, std::list>();
+ check_polygon<double, std::deque, std::deque>();
+
+ return 0;
+}
+

Added: sandbox/geometry/libs/geometry/test/compile_test.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/compile_test.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,29 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compile_test", "compile_test.vcproj", "{618D4B05-A06E-443B-87C0-94964CEA7164}"
+ ProjectSection(ProjectDependencies) = postProject
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A} = {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ggl_headers", "ggl_headers.vcproj", "{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {618D4B05-A06E-443B-87C0-94964CEA7164}.Debug|Win32.ActiveCfg = Debug|Win32
+ {618D4B05-A06E-443B-87C0-94964CEA7164}.Debug|Win32.Build.0 = Debug|Win32
+ {618D4B05-A06E-443B-87C0-94964CEA7164}.Release|Win32.ActiveCfg = Release|Win32
+ {618D4B05-A06E-443B-87C0-94964CEA7164}.Release|Win32.Build.0 = Release|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.Build.0 = Debug|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.ActiveCfg = Release|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/compile_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/compile_test.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="compile_test"
+ ProjectGUID="{618D4B05-A06E-443B-87C0-94964CEA7164}"
+ RootNamespace="compile_test"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\compile_test"
+ ConfigurationType="1"
+ InheritedPropertySheets=".\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\compile_test"
+ ConfigurationType="1"
+ InheritedPropertySheets=".\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="0"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\compile_test.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\algorithms\area.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\astext.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\box.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\centroid.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\circle.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\envelope.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\foreach.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometry.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\grow.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_polygon.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\intersection_segment.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\length.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\normalize.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\overlaps.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\geometries\segment.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\simplify.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\algorithms\within.hpp"
+ >
+ </File>
+ <Filter
+ Name="util"
+ >
+ <File
+ RelativePath="..\util\equals.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\reserve.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\selecttypetraits.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\util\side.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="strategies"
+ >
+ <File
+ RelativePath="..\strategies\strategies_point_ll.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\strategies\strategies_point_xy.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\strategies\strategy_traits.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/core/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,22 @@
+# test/core/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-core
+ :
+ [ run access.cpp ]
+ [ run coordinate_dimension.cpp ]
+ [ run coordinate_system.cpp ]
+ [ run coordinate_type.cpp ]
+ [ run geometry_id.cpp ]
+ [ run point_type.cpp ]
+ [ run radian_access.cpp ]
+ [ run reverse_dispatch.cpp ]
+ [ run ring.cpp ]
+ [ run tag.cpp ]
+ [ run topological_dimension.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/core/access.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/access.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,125 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/core/access.hpp>
+
+
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/algorithms/make.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+
+#include <boost/geometry/core/cs.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/segment.hpp>
+#include <boost/geometry/geometries/box.hpp>
+
+
+
+template <typename G>
+void test_get_set()
+{
+ typedef typename boost::geometry::coordinate_type<G>::type coordinate_type;
+
+ G g;
+ boost::geometry::set<0>(g, coordinate_type(1));
+ boost::geometry::set<1>(g, coordinate_type(2));
+
+ coordinate_type x = boost::geometry::get<0>(g);
+ coordinate_type y = boost::geometry::get<1>(g);
+
+ BOOST_CHECK_CLOSE(double(x), 1.0, 0.0001);
+ BOOST_CHECK_CLOSE(double(y), 2.0, 0.0001);
+}
+
+template <typename G>
+void test_indexed_get_set(G& g)
+{
+ boost::geometry::set<0, 0>(g, 1);
+ boost::geometry::set<0, 1>(g, 2);
+ boost::geometry::set<1, 0>(g, 3);
+ boost::geometry::set<1, 1>(g, 4);
+
+ typedef typename boost::geometry::coordinate_type<G>::type coordinate_type;
+ coordinate_type x1 = boost::geometry::get<0, 0>(g);
+ coordinate_type y1 = boost::geometry::get<0, 1>(g);
+ coordinate_type x2 = boost::geometry::get<1, 0>(g);
+ coordinate_type y2 = boost::geometry::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 <typename G, typename T>
+void test_indexed_get(G const& g, T a, T b, T c, T d)
+{
+ T x1 = boost::geometry::get<0, 0>(g);
+ T y1 = boost::geometry::get<0, 1>(g);
+ T x2 = boost::geometry::get<1, 0>(g);
+ T y2 = boost::geometry::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 <typename P>
+void test_all()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+
+ // POINT, setting coordinate
+ test_get_set<P>();
+
+
+ // BOX, setting left/right/top/bottom
+ boost::geometry::box<P> b;
+ test_indexed_get_set(b);
+
+ // SEGMENT (in GGL not having default constructor; however that is not a requirement)
+ P p1 = boost::geometry::make_zero<P>();
+ P p2 = boost::geometry::make_zero<P>();
+ boost::geometry::segment<P> s(p1, p2);
+ test_indexed_get_set(s);
+
+ // CONST SEGMENT
+ boost::geometry::set<0>(p1, 1); // we don't use assign because dim in {2,3}
+ boost::geometry::set<1>(p1, 2);
+ boost::geometry::set<0>(p2, 3);
+ boost::geometry::set<1>(p2, 4);
+ boost::geometry::segment<const P> 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<int[2]>();
+ test_get_set<float[2]>();
+ test_get_set<double[2]>();
+ test_get_set<double[3]>();
+
+ test_get_set<boost::tuple<double, double> >();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/access.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/access.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="access"
+ ProjectGUID="{5542B963-D229-4393-968F-E62DDCE4B87B}"
+ RootNamespace="access"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\access"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\access"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\access.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/core/coordinate_dimension.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/coordinate_dimension.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,69 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/core/coordinate_dimension.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, std::size_t Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(boost::geometry::dimension<G>::type::value, Expected);
+}
+
+template <typename P, size_t D>
+void test_all()
+{
+ test_geometry<P, D>();
+ test_geometry<const P, D>();
+ test_geometry<boost::geometry::linestring<P> , D>();
+ test_geometry<boost::geometry::linear_ring<P> , D>();
+ test_geometry<boost::geometry::polygon<P> , D>();
+ test_geometry<boost::geometry::box<P> , D>();
+ test_geometry<boost::geometry::segment<P> , D>();
+ test_geometry<boost::geometry::segment<const P> , D>();
+
+ test_geometry<std::vector<P>, D>();
+ test_geometry<std::deque<P>, D>();
+
+ test_geometry<boost::array<P, 5>, D>();
+}
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], 2>();
+ test_geometry<float[2], 2>();
+ test_geometry<double[2], 2>();
+
+ test_geometry<int[3], 3>();
+ test_geometry<float[3], 3>();
+ test_geometry<double[3], 3>();
+
+ test_geometry<boost::tuple<double, double>, 2>();
+ test_geometry<boost::tuple<double, double, double>, 3>();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian>, 2 >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian>, 2 >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian>, 2 >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/coordinate_system.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/coordinate_system.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,96 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/core/coordinate_system.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, typename Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(typeid(typename boost::geometry::coordinate_system<G>::type).name(),
+ typeid(Expected).name());
+}
+
+template <typename P, typename Expected>
+void test_all()
+{
+ test_geometry<P, Expected>();
+ test_geometry<const P, Expected>();
+ test_geometry<boost::geometry::linestring<P> , Expected>();
+ test_geometry<boost::geometry::linear_ring<P> , Expected>();
+ test_geometry<boost::geometry::polygon<P> , Expected>();
+ test_geometry<boost::geometry::box<P> , Expected>();
+ test_geometry<boost::geometry::segment<P> , Expected>();
+ test_geometry<boost::geometry::segment<const P> , Expected>();
+
+ test_geometry<std::vector<P>, Expected>();
+ test_geometry<std::deque<P>, Expected>();
+
+ test_geometry<boost::array<P, 5>, Expected>();
+}
+
+int test_main(int, char* [])
+{
+ // Because of the included headerfiles, there are always cartesian
+ test_geometry<int[2], boost::geometry::cs::cartesian>();
+ test_geometry<float[2], boost::geometry::cs::cartesian>();
+ test_geometry<double[2], boost::geometry::cs::cartesian>();
+
+ test_geometry<int[3], boost::geometry::cs::cartesian>();
+ test_geometry<float[3], boost::geometry::cs::cartesian>();
+ test_geometry<double[3], boost::geometry::cs::cartesian>();
+
+ // Because of the included headerfiles, there are always cartesian
+ test_geometry<boost::tuple<double, double>, boost::geometry::cs::cartesian>();
+ test_geometry<boost::tuple<double, double, double>, boost::geometry::cs::cartesian>();
+
+
+ // Test cartesian
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian>, boost::geometry::cs::cartesian>();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian>, boost::geometry::cs::cartesian>();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian>, boost::geometry::cs::cartesian>();
+
+ // Test spherical
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::spherical<boost::geometry::degree> >,
+ boost::geometry::cs::spherical<boost::geometry::degree> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::spherical<boost::geometry::degree> >,
+ boost::geometry::cs::spherical<boost::geometry::degree> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> >,
+ boost::geometry::cs::spherical<boost::geometry::degree> >();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::spherical<boost::geometry::radian> >,
+ boost::geometry::cs::spherical<boost::geometry::radian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::spherical<boost::geometry::radian> >,
+ boost::geometry::cs::spherical<boost::geometry::radian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::radian> >,
+ boost::geometry::cs::spherical<boost::geometry::radian> >();
+
+ // Test other
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::polar<boost::geometry::degree> >,
+ boost::geometry::cs::polar<boost::geometry::degree> >();
+
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::geographic<boost::geometry::degree> >,
+ boost::geometry::cs::geographic<boost::geometry::degree> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/coordinate_type.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/coordinate_type.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,73 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/core/coordinate_type.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, typename Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(typeid(typename boost::geometry::coordinate_type<G>::type).name(),
+ typeid(Expected).name());
+}
+
+template <typename P, typename Expected>
+void test_all()
+{
+ test_geometry<P, Expected>();
+ test_geometry<const P, Expected>();
+ test_geometry<boost::geometry::linestring<P> , Expected>();
+ test_geometry<boost::geometry::linear_ring<P> , Expected>();
+ test_geometry<boost::geometry::polygon<P> , Expected>();
+ test_geometry<boost::geometry::box<P> , Expected>();
+ test_geometry<boost::geometry::segment<P> , Expected>();
+ test_geometry<boost::geometry::segment<const P> , Expected>();
+
+ test_geometry<std::vector<P>, Expected>();
+ test_geometry<std::deque<P>, Expected>();
+
+ test_geometry<boost::array<P, 5>, Expected>();
+}
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], int>();
+ test_geometry<float[2], float>();
+ test_geometry<double[2], double>();
+
+ test_geometry<int[3], int>();
+ test_geometry<float[3], float>();
+ test_geometry<double[3], double>();
+
+ test_geometry<boost::tuple<float, float>, float>();
+ test_geometry<boost::tuple<double, double>, double>();
+ test_geometry<boost::tuple<long double, long double>, long double>();
+ test_geometry<boost::tuple<double, double, double>, double>();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian>, int>();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian>, float>();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian>, double>();
+ test_all<boost::geometry::point<long double, 2, boost::geometry::cs::cartesian>, long double>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/core.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/core.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,31 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "access", "access.vcproj", "{5542B963-D229-4393-968F-E62DDCE4B87B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reverse_dispatch", "reverse_dispatch.vcproj", "{EA65AF97-67BC-49C8-9CAF-4136514A41EE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "radian_access", "radian_access.vcproj", "{DE2968B5-DCA6-4D85-A620-7DA111FC0E06}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Debug|Win32.Build.0 = Debug|Win32
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Release|Win32.ActiveCfg = Release|Win32
+ {5542B963-D229-4393-968F-E62DDCE4B87B}.Release|Win32.Build.0 = Release|Win32
+ {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Debug|Win32.Build.0 = Debug|Win32
+ {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Release|Win32.ActiveCfg = Release|Win32
+ {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Release|Win32.Build.0 = Release|Win32
+ {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Debug|Win32.Build.0 = Debug|Win32
+ {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Release|Win32.ActiveCfg = Release|Win32
+ {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/core/geometry_id.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/geometry_id.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,68 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/core/geometry_id.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, std::size_t Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(boost::geometry::geometry_id<G>::type::value, Expected);
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<P, 1>();
+ test_geometry<const P, 1>();
+ test_geometry<boost::geometry::linestring<P> , 2>();
+ test_geometry<boost::geometry::linear_ring<P> , 93>();
+ test_geometry<boost::geometry::polygon<P> , 3>();
+ test_geometry<boost::geometry::box<P> , 94>();
+ test_geometry<boost::geometry::segment<P> , 92>();
+ test_geometry<boost::geometry::segment<const P> , 92>();
+
+ test_geometry<std::vector<P>, 2>();
+ test_geometry<std::deque<P>, 2>();
+
+ test_geometry<boost::array<P, 5>, 2>();
+}
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], 1>();
+ test_geometry<float[2], 1>();
+ test_geometry<double[2], 1>();
+
+ test_geometry<int[3], 1>();
+ test_geometry<float[3], 1>();
+ test_geometry<double[3], 1>();
+
+ test_geometry<boost::tuple<double, double>, 1>();
+ test_geometry<boost::tuple<double, double, double>, 1>();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/point_type.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/point_type.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,71 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/core/tag.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, typename Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(typeid(typename boost::geometry::point_type<G>::type).name(),
+ typeid(Expected).name());
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<P, P>();
+ test_geometry<const P, P>();
+ test_geometry<boost::geometry::linestring<P> , P>();
+ test_geometry<boost::geometry::linear_ring<P> , P>();
+ test_geometry<boost::geometry::polygon<P> , P>();
+ test_geometry<boost::geometry::box<P> , P>();
+ test_geometry<boost::geometry::segment<P> , P>();
+ test_geometry<boost::geometry::segment<const P> , P>();
+
+ test_geometry<std::vector<P>, P>();
+ test_geometry<std::deque<P>, P>();
+
+ test_geometry<boost::array<P, 5>, P>();
+}
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], int[2]>();
+ test_geometry<float[2], float[2]>();
+ test_geometry<double[2], double[2]>();
+
+ test_geometry<int[3], int[3]>();
+ test_geometry<float[3], float[3]>();
+ test_geometry<double[3], double[3]>();
+
+ test_geometry<boost::tuple<double, double>,
+ boost::tuple<double, double> >();
+ test_geometry<boost::tuple<double, double, double>,
+ boost::tuple<double, double, double> >();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/radian_access.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/radian_access.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,104 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/core/radian_access.hpp>
+
+#include <boost/geometry/core/cs.hpp>
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/geometries/point.hpp>
+
+
+template <std::size_t D, typename P, typename T>
+void test_get(T const& c, T const& e)
+{
+ //std::cout << "get_as_radian " << typeid(P).name() << std::endl;
+
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+
+ P p;
+ boost::geometry::set<D>(p, coordinate_type(c));
+
+ coordinate_type g = boost::geometry::get_as_radian<D>(p);
+
+ BOOST_CHECK_CLOSE(double(g), double(e), 0.0001);
+}
+
+
+template <std::size_t D, typename P, typename T>
+void test_set(T const& c, T const& e)
+{
+ //std::cout << "set_from_radian " << typeid(P).name() << std::endl;
+
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+
+ P p;
+ boost::geometry::set_from_radian<D>(p, coordinate_type(c));
+
+ coordinate_type g = boost::geometry::get<D>(p);
+
+ BOOST_CHECK_CLOSE(double(g), double(e), 0.0001);
+}
+
+
+template <typename T>
+void test()
+{
+ double d2r = 3.1415926535897932384626433832795 / 180.0;
+
+ // Degree
+ test_get<0, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >
+ (1.0, 1.0 * d2r);
+ test_get<1, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >
+ (2.0, 2.0 * d2r);
+
+ test_set<0, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >
+ (1.0, 1.0 / d2r);
+ test_set<1, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >
+ (2.0, 2.0 / d2r);
+
+
+ // Radian
+ test_get<0, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::radian> > >
+ (1.0, 1.0);
+ test_get<1, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::radian> > >
+ (1.0, 1.0);
+
+ test_set<0, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::radian> > >
+ (1.0, 1.0);
+ test_set<1, boost::geometry::point<T, 2, boost::geometry::cs::spherical<boost::geometry::radian> > >
+ (1.0, 1.0);
+
+
+ // Cartesian (== untouched, no conversion)
+ test_get<0, boost::geometry::point<T, 2, boost::geometry::cs::cartesian> >
+ (1.0, 1.0);
+ test_get<1, boost::geometry::point<T, 2, boost::geometry::cs::cartesian> >
+ (1.0, 1.0);
+
+ // Dimension >=2, should always be untouched, even for degree
+ // (assuming lat/lon + height)
+ test_set<2, boost::geometry::point<T, 3, boost::geometry::cs::spherical<boost::geometry::radian> > >
+ (1.0, 1.0);
+ test_set<2, boost::geometry::point<T, 3, boost::geometry::cs::spherical<boost::geometry::degree> > >
+ (1.0, 1.0);
+
+}
+
+
+
+
+int test_main(int, char* [])
+{
+ //test<float>();
+ test<double>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/radian_access.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/radian_access.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="radian_access"
+ ProjectGUID="{DE2968B5-DCA6-4D85-A620-7DA111FC0E06}"
+ RootNamespace="radian_access"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\radian_access"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\radian_access"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\radian_access.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/core/reverse_dispatch.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/reverse_dispatch.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,59 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/core/reverse_dispatch.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+
+
+template <typename Geometry1, typename Geometry2, bool Expected>
+void test_reversed()
+{
+ BOOST_CHECK_EQUAL((boost::geometry::reverse_dispatch<Geometry1, Geometry2>::type::value),
+ Expected);
+}
+
+
+template <typename P>
+void test_all()
+{
+
+ test_reversed<P, P, false>();
+ test_reversed<P, boost::geometry::linestring<P>, false>();
+ test_reversed<boost::geometry::linestring<P>, P, true>();
+ test_reversed<boost::geometry::linear_ring<P>, P, true>();
+ test_reversed<boost::geometry::linestring<P>, boost::geometry::linear_ring<P>, false>();
+ test_reversed<boost::geometry::linear_ring<P>, boost::geometry::linestring<P>, true>();
+}
+
+template <typename P1, typename P2>
+void test_mixed()
+{
+ test_reversed<P1, P2, false>();
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_mixed
+ <
+ boost::geometry::point<int, 2, boost::geometry::cs::cartesian>,
+ boost::geometry::point<int, 2, boost::geometry::cs::spherical<boost::geometry::degree> >
+ >();
+ test_mixed
+ <
+ boost::geometry::point<int, 2, boost::geometry::cs::spherical<boost::geometry::degree> >,
+ boost::geometry::point<int, 2, boost::geometry::cs::spherical<boost::geometry::radian> >
+ >();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/reverse_dispatch.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/reverse_dispatch.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="reverse_dispatch"
+ ProjectGUID="{EA65AF97-67BC-49C8-9CAF-4136514A41EE}"
+ RootNamespace="reverse_dispatch"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\reverse_dispatch"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\reverse_dispatch"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\reverse_dispatch.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/core/ring.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/ring.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,68 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+// To be tested:
+#include <boost/geometry/core/ring_type.hpp>
+#include <boost/geometry/core/exterior_ring.hpp>
+#include <boost/geometry/core/interior_rings.hpp>
+
+// For geometries:
+#include <boost/geometry/core/cs.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+
+
+template <typename P>
+void test_ring(std::string const& wkt,
+ int expected_main_count,
+ int expected_interior_ring_count,
+ int expected_first_interior_count)
+{
+ typedef boost::geometry::polygon<P> the_polygon;
+ typedef typename boost::geometry::ring_type<the_polygon>::type the_ring;
+ typedef typename boost::geometry::interior_type<the_polygon>::type the_interior;
+
+ the_polygon poly;
+ read_wkt(wkt, poly);
+
+ the_ring ext = boost::geometry::exterior_ring(poly);
+ the_interior rings = boost::geometry::interior_rings(poly);
+
+ BOOST_CHECK_EQUAL(boost::geometry::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) > 0)
+ {
+ BOOST_CHECK_EQUAL(boost::size(rings.front()), expected_first_interior_count);
+ }
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_ring<P>("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<P>("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<P>("POLYGON((0 0,0 3,3 3,3 0,0 0))", 5, 0, 0);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/tag.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/tag.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,68 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/core/tag.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, typename Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(typeid(typename boost::geometry::tag<G>::type).name(),
+ typeid(Expected).name());
+}
+
+template <typename P, size_t D>
+void test_all()
+{
+ test_geometry<P, boost::geometry::point_tag>();
+ test_geometry<const P, boost::geometry::point_tag>();
+ test_geometry<boost::geometry::linestring<P> , boost::geometry::linestring_tag>();
+ test_geometry<boost::geometry::linear_ring<P> , boost::geometry::ring_tag>();
+ test_geometry<boost::geometry::polygon<P> , boost::geometry::polygon_tag>();
+ test_geometry<boost::geometry::box<P> , boost::geometry::box_tag>();
+ test_geometry<boost::geometry::segment<P> , boost::geometry::segment_tag>();
+ test_geometry<boost::geometry::segment<const P> , boost::geometry::segment_tag>();
+
+ test_geometry<std::vector<P>, boost::geometry::linestring_tag>();
+ test_geometry<std::deque<P>, boost::geometry::linestring_tag>();
+
+ test_geometry<boost::array<P, 5>, boost::geometry::linestring_tag>();
+}
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], boost::geometry::point_tag>();
+ test_geometry<float[2], boost::geometry::point_tag>();
+ test_geometry<double[2], boost::geometry::point_tag>();
+
+ test_geometry<int[3], boost::geometry::point_tag>();
+ test_geometry<float[3], boost::geometry::point_tag>();
+ test_geometry<double[3], boost::geometry::point_tag>();
+
+ test_geometry<boost::tuple<double, double>, boost::geometry::point_tag>();
+ test_geometry<boost::tuple<double, double, double>, boost::geometry::point_tag>();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian>, 2 >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian>, 2 >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian>, 2 >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/core/topological_dimension.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/core/topological_dimension.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,67 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/core/topological_dimension.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, std::size_t Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(boost::geometry::topological_dimension<G>::type::value, Expected);
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<P, 0>();
+ test_geometry<const P, 0>();
+ test_geometry<boost::geometry::linestring<P> , 1>();
+ test_geometry<boost::geometry::linear_ring<P> , 2>(); // being discussed
+ test_geometry<boost::geometry::polygon<P> , 2>();
+ test_geometry<boost::geometry::box<P> , 2>();
+ test_geometry<boost::geometry::segment<P> , 1>();
+ test_geometry<boost::geometry::segment<const P> , 1>();
+
+ test_geometry<std::vector<P>, 1>();
+ test_geometry<std::deque<P>, 1>();
+
+ test_geometry<boost::array<P, 5>, 1>();
+}
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], 0>();
+ test_geometry<float[2], 0>();
+ test_geometry<double[2], 0>();
+
+ test_geometry<int[3], 0>();
+ test_geometry<float[3], 0>();
+ test_geometry<double[3], 0>();
+
+ test_geometry<boost::tuple<double, double>, 0>();
+ test_geometry<boost::tuple<double, double, double>, 0>();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/custom_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/custom_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point", "point_concept\well_formed_point.vcproj", "{B63710DE-960E-4C00-B79A-7C8F80D6BC15}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point_traits", "point_concept\well_formed_point_traits.vcproj", "{4F767915-5FC0-4BEB-8948-F371896BBD59}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_array_point", "point_concept\array_point.vcproj", "{436E02F5-A4E6-40F8-8E41-57560875D67F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_point_with_incorrect_coord_count", "point_concept\point_with_incorrect_coord_count.vcproj", "{B696EDCA-4602-4962-8A1C-043B3F44B978}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Debug|Win32.Build.0 = Debug|Win32
+ {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Release|Win32.ActiveCfg = Release|Win32
+ {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Release|Win32.Build.0 = Release|Win32
+ {4F767915-5FC0-4BEB-8948-F371896BBD59}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4F767915-5FC0-4BEB-8948-F371896BBD59}.Debug|Win32.Build.0 = Debug|Win32
+ {4F767915-5FC0-4BEB-8948-F371896BBD59}.Release|Win32.ActiveCfg = Release|Win32
+ {4F767915-5FC0-4BEB-8948-F371896BBD59}.Release|Win32.Build.0 = Release|Win32
+ {436E02F5-A4E6-40F8-8E41-57560875D67F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {436E02F5-A4E6-40F8-8E41-57560875D67F}.Debug|Win32.Build.0 = Debug|Win32
+ {436E02F5-A4E6-40F8-8E41-57560875D67F}.Release|Win32.ActiveCfg = Release|Win32
+ {436E02F5-A4E6-40F8-8E41-57560875D67F}.Release|Win32.Build.0 = Release|Win32
+ {B696EDCA-4602-4962-8A1C-043B3F44B978}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B696EDCA-4602-4962-8A1C-043B3F44B978}.Debug|Win32.Build.0 = Debug|Win32
+ {B696EDCA-4602-4962-8A1C-043B3F44B978}.Release|Win32.ActiveCfg = Release|Win32
+ {B696EDCA-4602-4962-8A1C-043B3F44B978}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/io_wkb_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/io_wkb_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "read_wkb", "read_wkb.vcproj", "{F2A680B0-F6FC-479E-9988-24CF6851C13C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Debug|Win32.Build.0 = Debug|Win32
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Release|Win32.ActiveCfg = Release|Win32
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/read_wkb.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/read_wkb.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,104 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Mateusz Loskot <mateusz_at_[hidden]>, 2009
+// Use, modification and distribution is subject to the 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 <iterator>
+#include <string>
+#include <vector>
+
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/included/unit_test.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/geometry/algorithms/equals.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkb/read_wkb.hpp>
+#include <boost/geometry/extensions/gis/io/wkb/utility.hpp>
+
+namespace { // anonymous
+
+typedef std::vector<boost::uint8_t> byte_vector;
+
+template <typename Geometry>
+void test_geometry_wrong_wkb(std::string const& wkbhex, std::string const& wkt)
+{
+ byte_vector wkb;
+ BOOST_CHECK( boost::geometry::hex2wkb(wkbhex, std::back_inserter(wkb)) );
+ Geometry g_wkb;
+ std::cout << boost::geometry::read_wkb(wkb.begin(), wkb.end(), g_wkb) << std::endl;
+}
+
+template <typename Geometry, bool IsEqual>
+void test_geometry_equals(std::string const& wkbhex, std::string const& wkt)
+{
+ byte_vector wkb;
+ BOOST_CHECK( boost::geometry::hex2wkb(wkbhex, std::back_inserter(wkb)) );
+ Geometry g_wkb;
+ BOOST_CHECK( boost::geometry::read_wkb(wkb.begin(), wkb.end(), g_wkb) );
+
+ Geometry g_expected;
+ boost::geometry::read_wkt(wkt, g_expected);
+ BOOST_CHECK( boost::geometry::equals(g_wkb, g_expected) == IsEqual );
+}
+
+//template <typename P, bool Result>
+//void test_polygon_wkt(std::string const& wkt)
+//{
+// typedef boost::geometry::linestring<P> linestring_type;
+// typedef boost::geometry::polygon<linestring_type> polygon_type;
+//
+// polygon_type poly;
+// boost::geometry::read_wkb(wkb, poly);
+//}
+
+} // namespace anonymous
+
+int test_main(int, char* [])
+{
+ typedef boost::geometry::point<double, 2, boost::geometry::cs::cartesian> point_type;
+ typedef boost::geometry::linestring<point_type> linestring_type;
+
+ //
+ // POINT
+ //
+
+ test_geometry_equals<point_type, true>(
+ "01010000005839B4C876BEF33F83C0CAA145B61640", "POINT (1.234 5.678)");
+
+ // XYZ - POINT(1.234 5.678 99) - Z coordinate ignored
+ test_geometry_equals<point_type, true>(
+ "01010000805839B4C876BEF33F83C0CAA145B616400000000000C05840", "POINT(1.234 5.678)");
+
+ // SRID=32632;POINT(1.234 5.678) - PostGIS EWKT
+ test_geometry_equals<point_type, false>(
+ "0101000020787F00005839B4C876BEF33F83C0CAA145B61640", "POINT (1.234 5.678)");
+
+ // SRID=4326;POINT(1.234 5.678 99) - PostGIS EWKT
+ test_geometry_equals<point_type, false>(
+ "01010000A0E61000005839B4C876BEF33F83C0CAA145B616400000000000C05840", "POINT(1.234 5.678)");
+
+ // POINTM(1.234 5.678 99) - XYM with M compound ignored
+ test_geometry_equals<point_type, true>(
+ "01010000405839B4C876BEF33F83C0CAA145B616400000000000C05840", "POINT (1.234 5.678)");
+
+ // SRID=32632;POINTM(1.234 5.678 99)
+ test_geometry_equals<point_type, false>(
+ "0101000060787F00005839B4C876BEF33F83C0CAA145B616400000000000C05840", "POINT (1.234 5.678)");
+
+ // POINT(1.234 5.678 15 79) - XYZM - Z and M compounds ignored
+ test_geometry_equals<point_type, true>(
+ "01010000C05839B4C876BEF33F83C0CAA145B616400000000000002E400000000000C05340",
+ "POINT (1.234 5.678)");
+
+ // SRID=4326;POINT(1.234 5.678 15 79) - XYZM + SRID
+ test_geometry_equals<point_type, false>(
+ "01010000E0E61000005839B4C876BEF33F83C0CAA145B616400000000000002E400000000000C05340",
+ "POINT (1.234 5.678)");
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/read_wkb.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkb/read_wkb.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="read_wkb"
+ ProjectGUID="{F2A680B0-F6FC-479E-9988-24CF6851C13C}"
+ RootNamespace="read_wkb"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\read_wkb"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../..//../../..;../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\read_wkb"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../..//../../..;../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\read_wkb.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/io_wkt_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/io_wkt_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,29 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wkt", "wkt.vcproj", "{1FA2ADE2-F649-4245-951E-A8F5935E7127}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_wkt", "multi_wkt.vcproj", "{CA8D5E44-7D8F-44A1-900C-35C28890299B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Debug|Win32.Build.0 = Debug|Win32
+ {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Release|Win32.ActiveCfg = Release|Win32
+ {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Release|Win32.Build.0 = Release|Win32
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Debug|Win32.Build.0 = Debug|Win32
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Release|Win32.ActiveCfg = Release|Win32
+ {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Release|Win32.Build.0 = Release|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/multi_wkt.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/multi_wkt.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,82 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008-2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <sstream>
+#include <string>
+
+#include <boost/algorithm/string.hpp>
+#include <boost/concept/requires.hpp>
+
+#include <boost/test/floating_point_comparison.hpp>
+#include <boost/test/included/test_exec_monitor.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+
+#include <boost/geometry/multi/algorithms/area.hpp>
+#include <boost/geometry/multi/algorithms/length.hpp>
+#include <boost/geometry/multi/algorithms/num_points.hpp>
+#include <boost/geometry/multi/algorithms/perimeter.hpp>
+#include <boost/geometry/multi/core/point_type.hpp>
+#include <boost/geometry/multi/core/topological_dimension.hpp>
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt_multi.hpp>
+
+
+template <typename T>
+void test_all();
+
+
+// Include the single test
+#define GGL_TEST_MULTI
+#include "extensions/gis/io/wkt/wkt.cpp"
+
+
+
+template <typename T>
+void test_all()
+{
+ using namespace boost::geometry;
+ typedef point<T, 2, boost::geometry::cs::cartesian> P;
+
+ test_wkt<multi_point<P> >("multipoint((1 2),(3 4))", 2);
+ test_wkt<multi_linestring<linestring<P> > >("multilinestring((1 1,2 2,3 3),(4 4,5 5,6 6))", 6, 4 * sqrt(2.0));
+ test_wkt<multi_polygon<polygon<P> > >("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, 19, 28);
+
+ test_wrong_wkt<multi_polygon<polygon<P> > >(
+ "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 '('");
+}
+
+
+
+/*
+
+... 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)))'))
+
+*/

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/multi_wkt.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/multi_wkt.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_wkt"
+ ProjectGUID="{CA8D5E44-7D8F-44A1-900C-35C28890299B}"
+ RootNamespace="multi_wkt"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_wkt"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../..//../../..;../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_wkt"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../..//../../..;../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_wkt.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/wkt.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/wkt.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,230 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008-2009
+// Use, modification and distribution is subject to the 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 <iostream>
+#include <sstream>
+#include <string>
+
+#include <boost/algorithm/string.hpp>
+
+#include <ggl_test_common.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/length.hpp>
+#include <boost/geometry/algorithms/num_points.hpp>
+#include <boost/geometry/algorithms/perimeter.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/core/point_type.hpp>
+#include <boost/geometry/core/topological_dimension.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/write_wkt.hpp>
+
+
+#if defined(HAVE_GMP)
+# include <boost/numeric_adaptor/gmp_value_type.hpp>
+#endif
+#if defined(HAVE_CLN)
+# include <boost/numeric_adaptor/cln_value_type.hpp>
+#endif
+
+
+
+
+template <typename G>
+void test_wkt(std::string const& wkt, int n, double len = 0,
+ double ar = 0, double peri = 0)
+{
+ G geometry;
+
+ boost::geometry::read_wkt(wkt, geometry);
+
+ /*
+ std::cout << "n=" << boost::geometry::num_points(geometry)
+ << " dim=" << boost::geometry::topological_dimension<G>::value
+ << " length=" << boost::geometry::length(geometry)
+ << " area=" << boost::geometry::area(geometry)
+ << " perimeter=" << boost::geometry::perimeter(geometry)
+ << std::endl << "\t\tgeometry=" << dsv(geometry)
+ << std::endl;
+ */
+
+ BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), n);
+ BOOST_CHECK_CLOSE(double(boost::geometry::length(geometry)), len, 0.0001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::area(geometry)), ar, 0.0001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::perimeter(geometry)), peri, 0.0001);
+
+ // String comparison: only for int/double/float etc
+ // GMP/CLN add +e01, L0, etc
+ if (boost::is_fundamental
+ <
+ typename boost::geometry::coordinate_type<G>::type
+ >::type::value)
+ {
+ std::ostringstream out;
+ out << boost::geometry::wkt(geometry);
+ BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()),
+ boost::to_upper_copy(wkt));
+ }
+}
+
+template <typename G>
+void test_relaxed_wkt(std::string const& wkt, std::string const& expected)
+{
+ if (boost::is_fundamental
+ <
+ typename boost::geometry::coordinate_type<G>::type
+ >::type::value)
+ {
+ std::string e;
+ G geometry;
+ boost::geometry::read_wkt(wkt, geometry);
+ std::ostringstream out;
+ out << boost::geometry::wkt(geometry);
+
+ BOOST_CHECK_EQUAL(boost::to_upper_copy(out.str()), boost::to_upper_copy(expected));
+ }
+}
+
+
+
+template <typename G>
+void test_wrong_wkt(std::string const& wkt, std::string const& start)
+{
+ std::string e("no exception");
+ G geometry;
+ try
+ {
+ boost::geometry::read_wkt(wkt, geometry);
+ }
+ catch(boost::geometry::read_wkt_exception const& ex)
+ {
+ e = ex.what();
+ boost::to_lower(e);
+ }
+ BOOST_CHECK_MESSAGE(boost::starts_with(e, start), " Expected:"
+ << start << " Got:" << e << " with WKT: " << wkt);
+}
+
+
+#ifndef GGL_TEST_MULTI
+template <typename T>
+void test_all()
+{
+ using namespace boost::geometry;
+ typedef point<T, 2, boost::geometry::cs::cartesian> P;
+
+ test_wkt<P >("POINT(1 2)", 1);
+ test_wkt<linestring<P> >("LINESTRING(1 1,2 2,3 3)", 3, 2 * sqrt(2.0));
+ test_wkt<polygon<P> >("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, 14, 24);
+
+ // Non OGC: a box defined by a polygon
+ //test_wkt<box<P> >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 4, 0, 1, 4);
+ test_wkt<linear_ring<P> >("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<P> >("LINESTRING()", 0, 0);
+ test_wkt<polygon<P> >("POLYGON(())", 0);
+ // ... or even with empty holes
+ test_wkt<polygon<P> >("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<P>("POINT(1)", "POINT(1 0)");
+ test_relaxed_wkt<P>("POINT()", "POINT(0 0)");
+ test_relaxed_wkt<linestring<P> >("LINESTRING(1,2,3)",
+ "LINESTRING(1 0,2 0,3 0)");
+ test_relaxed_wkt<P>("POINT ( 1 2) ", "POINT(1 2)");
+ test_relaxed_wkt<P>("POINT M ( 1 2)", "POINT(1 2)");
+ test_relaxed_wkt<box<P> >("BOX(1 1,2 2)", "POLYGON((1 1,1 2,2 2,2 1,1 1))");
+
+ test_relaxed_wkt<linestring<P> >("LINESTRING EMPTY", "LINESTRING()");
+
+ test_relaxed_wkt<polygon<P> >("POLYGON( ( ) , ( ) , ( ) )",
+ "POLYGON((),(),())");
+
+ // Wrong WKT's
+ test_wrong_wkt<P>("POINT(1 2", "expected ')'");
+ test_wrong_wkt<P>("POINT 1 2)", "expected '('");
+ test_wrong_wkt<P>("POINT(1 2,)", "expected ')'");
+ test_wrong_wkt<P>("POINT(1 2)foo", "too much tokens at 'foo'");
+ test_wrong_wkt<P>("POINT(1 2 3)", "expected ')'");
+ test_wrong_wkt<P>("POINT(a 2 3)", "bad lexical cast");
+ test_wrong_wkt<P>("POINT 2 3", "expected '('");
+ test_wrong_wkt<P>("POINT Z (1 2 3)", "z only allowed");
+
+ test_wrong_wkt<P>("PIONT (1 2)", "should start with 'point'");
+
+ test_wrong_wkt<linestring<P> >("LINESTRING())", "too much tokens");
+
+ test_wrong_wkt<polygon<P> >("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<P> >("BOX(1 1,2 2,3 3)", "box should have 2");
+ test_wrong_wkt<box<P> >("BOX(1 1,2 2) )", "too much tokens");
+
+ if (boost::is_floating_point<T>::type::value
+ || ! boost::is_fundamental<T>::type::value)
+ {
+ test_wkt<P >("POINT(1.1 2.1)", 1);
+ }
+
+}
+#endif
+
+
+int test_main(int, char* [])
+{
+ test_all<double>();
+ test_all<int>();
+
+#if defined(HAVE_CLN)
+ std::cout << "testing CLN points" << std::endl;
+ test_all<boost::numeric_adaptor::cln_value_type>();
+#endif
+#if defined(HAVE_GMP)
+ std::cout << "testing GMP points" << std::endl;
+ test_all<boost::numeric_adaptor::gmp_value_type>();
+#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))'))
+
+*/

Added: sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/wkt.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/io/wkt/wkt.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="wkt"
+ ProjectGUID="{1FA2ADE2-F649-4245-951E-A8F5935E7127}"
+ RootNamespace="wkt"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\wkt"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../..//../../..;../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\wkt"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../..//../../..;../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\wkt.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/andoyer.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/andoyer.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,58 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/gis/geographic/strategies/andoyer.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename P1, typename P2>
+void test_andoyer(double lon1, double lat1, double lon2, double lat2, double expected_km)
+{
+ boost::geometry::strategy::distance::andoyer<P1, P2> andoyer;
+
+ P1 p1, p2;
+
+ boost::geometry::assign(p1, lon1, lat1);
+ boost::geometry::assign(p2, lon2, lat2);
+
+ BOOST_CHECK_CLOSE(double(andoyer.apply(p1, p2)), 1000.0 * expected_km, 0.001);
+}
+
+template <typename P1, typename P2>
+void test_all()
+{
+ test_andoyer<P1, P2>(0, 90, 1, 80, 1116.814237); // polar
+ test_andoyer<P1, P2>(4, 52, 4, 52, 0.0); // no point difference
+ test_andoyer<P1, P2>(4, 52, 3, 40, 1336.039890); // normal case
+}
+
+template <typename P>
+void test_all()
+{
+ test_all<P, P>();
+}
+
+int test_main(int, char* [])
+{
+ using namespace boost::geometry;
+ using namespace boost::geometry::cs;
+
+ //test_all<float[2]>();
+ //test_all<double[2]>();
+ test_all<point<float, 2, geographic<degree> > >();
+ test_all<point<double, 2, geographic<degree> > >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/andoyer.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/andoyer.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="andoyer"
+ ProjectGUID="{CE0ECB77-1772-4F74-AB74-79C43CC3FD27}"
+ RootNamespace="andoyer"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\andoyer"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\andoyer"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\andoyer.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/area_ll.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/area_ll.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,173 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/transform.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/extensions/gis/latlong/point_ll.hpp>
+#include <boost/geometry/extensions/gis/geographic/strategies/area_huiller_earth.hpp>
+
+
+#include <boost/geometry/extensions/gis/projections/epsg.hpp>
+#include <boost/geometry/extensions/gis/projections/parameters.hpp>
+#include <boost/geometry/extensions/gis/projections/proj/sterea.hpp>
+
+#include <test_common/test_point.hpp>
+
+using namespace boost::geometry;
+
+template <typename PRJ, typename XY, typename LL>
+void add_to_ring(PRJ const& prj, LL const& ll,
+ boost::geometry::linear_ring<LL>& ring_ll,
+ boost::geometry::linear_ring<XY>& ring_xy)
+{
+ ring_ll.push_back(ll);
+
+ XY xy;
+ prj.forward(ll, xy);
+ ring_xy.push_back(xy);
+}
+
+template <typename XY, typename LL>
+void test_area_polygon_ll(bool concave, bool hole, double perc)
+{
+ BOOST_ASSERT(! (concave && hole) );
+
+ typedef typename coordinate_type<LL>::type T;
+
+ // Amsterdam, Rotterdam, The Hague, Utrecht,
+ // these cities together are the city group "Randstad"
+
+ LL a, r, h, u;
+ // Amsterdam 52 22'23"N 4 53'32"E
+ a.lat(dms<north, T>(52, 22, 23));
+ a.lon(dms<east, T>(4, 53, 32));
+
+ // Rotterdam 51 55'51"N 4 28'45"E
+ r.lat(dms<north, T>(51, 55, 51));
+ r.lon(dms<east, T>(4, 28, 45));
+
+ // The hague: 52 4' 48" N, 4 18' 0" E
+ h.lat(dms<north, T>(52, 4, 48));
+ h.lon(dms<east, T>(4, 18, 0));
+
+ // Utrecht
+ u.lat(dms<north, T>(52, 5, 36));
+ u.lon(dms<east, T>(5, 7, 10));
+
+
+ // For checking calculated area, use the Dutch projection (RD), this is EPSG code 28992
+ projection::sterea_ellipsoid<LL, XY> dutch_prj(projection::init(28992));
+
+ // Add them in clockwise direction
+ polygon<LL> randstad;
+ polygon<XY> randstad_xy;
+ add_to_ring(dutch_prj, a, randstad.outer(), randstad_xy.outer());
+ add_to_ring(dutch_prj, u, randstad.outer(), randstad_xy.outer());
+
+ // Concave case
+ if (concave)
+ {
+ // Add the city "Alphen" to create a concave case
+ // Alphen 52 7' 48" N, 4 39' 0" E
+ LL alphen(latitude<T>(dms<north, T>(52, 7, 48)), longitude<T>(dms<east, T>(4, 39)));
+ add_to_ring(dutch_prj, alphen, randstad.outer(), randstad_xy.outer());
+ }
+
+ add_to_ring(dutch_prj, r, randstad.outer(), randstad_xy.outer());
+ add_to_ring(dutch_prj, h, randstad.outer(), randstad_xy.outer());
+ add_to_ring(dutch_prj, a, randstad.outer(), randstad_xy.outer());
+
+ // Hole case
+ if (hole)
+ {
+ // Gouda 52 1' 12" N, 4 42' 0" E
+ LL gouda(latitude<T>(dms<north, T>(52, 1, 12)), longitude<T>(dms<east, T>(4, 42)));
+ // Woerden 52 5' 9" N, 4 53' 0" E
+ LL woerden(latitude<T>(dms<north, T>(52, 5, 9)), longitude<T>(dms<east, T>(4, 53, 0)));
+ // Uithoorn 52 13' 48" N, 4 49' 48" E
+ LL uithoorn(latitude<T>(dms<north, T>(52, 13, 48)), longitude<T>(dms<east, T>(4, 49, 48)));
+ // Alphen 52 7' 48" N, 4 39' 0" E
+ LL alphen(latitude<T>(dms<north, T>(52, 7, 48)), longitude<T>(dms<east, T>(4, 39)));
+
+ randstad.inners().resize(1);
+ randstad_xy.inners().resize(1);
+
+ typename polygon<LL>::ring_type& ring = randstad.inners()[0];
+ typename polygon<XY>::ring_type& ring_xy = randstad_xy.inners()[0];
+
+ // Add them in counter-clockwise direction (see map of the Netherlands)
+ add_to_ring(dutch_prj, gouda, ring, ring_xy);
+ add_to_ring(dutch_prj, woerden, ring, ring_xy);
+ add_to_ring(dutch_prj, uithoorn, ring, ring_xy);
+ add_to_ring(dutch_prj, alphen, ring, ring_xy);
+ add_to_ring(dutch_prj, gouda, ring, ring_xy);
+ }
+
+
+ // Check the area in square KM
+ static const double KM2 = 1.0e6;
+ double d_ll = area(randstad) / KM2;
+ double d_xy = area(randstad_xy) / KM2;
+
+ BOOST_CHECK_CLOSE(d_ll, d_xy, 1.0);
+ if (hole)
+ {
+ BOOST_CHECK_CLOSE(d_ll, 1148.210, perc);
+ BOOST_CHECK_CLOSE(d_xy, 1151.573, perc);
+ }
+ else
+ {
+ BOOST_CHECK_CLOSE(d_ll, concave ? 977.786 : 1356.168, perc);
+ BOOST_CHECK_CLOSE(d_xy, concave ? 980.658 : 1360.140, perc);
+
+ // No hole: area of outer should be equal to area of ring
+ double r_ll = area(randstad.outer()) / KM2;
+ double r_xy = area(randstad_xy.outer()) / KM2;
+
+ BOOST_CHECK_CLOSE(d_ll, r_ll, perc);
+ BOOST_CHECK_CLOSE(d_xy, r_xy, perc);
+ }
+
+ // Calculate are using specified strategy, here with radius in KM
+ // We then don't have to divide by KM*KM to get the same result
+ boost::geometry::strategy::area::huiller<LL, long double> strategy(6372.8);
+ d_ll = area(randstad, strategy);
+ BOOST_CHECK_CLOSE(d_ll, d_xy, 1.0);
+}
+
+
+
+template <typename T>
+void test_latlong(double perc)
+{
+ test_area_polygon_ll<point_xy<T>, point_ll<T, cs::geographic<degree> > >(false, false, perc);
+
+ // with concavities
+ test_area_polygon_ll<point_xy<T>, point_ll<T, cs::geographic<degree> > >(true, false, perc);
+
+ // with holes
+ test_area_polygon_ll<point_xy<T>, point_ll<T, cs::geographic<degree> > >(false, true, perc);
+}
+
+int test_main(int, char* [])
+{
+ test_latlong<double>(0.01);
+ //test_latlong<float>(0.3); // LL area calculations using projections differ
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/area_ll.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/area_ll.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="area_ll"
+ ProjectGUID="{BA69A6CC-52F0-45AD-A43E-00FE3416F8C5}"
+ RootNamespace="area_ll"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area_ll"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area_ll"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\area_ll.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/distance_mixed.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/distance_mixed.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,73 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+#include <boost/test/unit_test.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/extensions/gis/latlong/latlong.hpp>
+
+#include <test_common/test_point.hpp>
+
+
+
+int test_main(int, char* [])
+{
+ using namespace boost::geometry;
+ using namespace boost::geometry::strategy::distance;
+
+ point_ll_deg paris;
+ paris.lat(dms<north>(48, 52, 0));
+ paris.lon(dms<east>(2, 19, 59));
+
+ point_ll_deg amsterdam;
+ amsterdam.lat(dms<north>(52, 22, 23));
+ amsterdam.lon(dms<east>(4, 53, 32));
+
+ point_ll_rad paris_rad, amsterdam_rad;
+ transform(amsterdam, amsterdam_rad);
+ transform(paris, paris_rad);
+
+ double d1 = 0.001 * distance(paris, amsterdam);
+ double d2 = 0.001 * distance(paris_rad, amsterdam_rad);
+
+ double d3 = 0.001 * distance(paris, amsterdam_rad);
+ double d4 = 0.001 * distance(paris_rad, amsterdam);
+ std::cout << "Distances: " << d1 << " == " << d2 << " == " << d3 << " == " << d4 << std::endl;
+
+ double d5 = 0.001 * distance(paris, amsterdam, vincenty<point_ll_deg, point_ll_deg>());
+ double d6 = 0.001 * distance(paris_rad, amsterdam_rad, vincenty<point_ll_rad, point_ll_rad>());
+ double d7 = 0.001 * distance(paris, amsterdam_rad, vincenty<point_ll_deg, point_ll_rad>());
+ double d8 = 0.001 * distance(paris_rad, amsterdam, vincenty<point_ll_rad, point_ll_deg>());
+ std::cout << "Distances: " << d5 << " == " << d6 << " == " << d7 << " == " << d8 << std::endl;
+
+ point_ll_deg barcelona(
+ latitude<>(dms<north>(41, 23)),
+ longitude<>(dms<east>(2, 11))
+ );
+
+ // Now declare a line in latlong and calculate the distance, this MUST reverse...
+ linestring_ll_deg ab;
+ ab.push_back(amsterdam);
+ ab.push_back(barcelona);
+
+ double d9 = 0.001 * distance(ab, paris);
+ double d10 = 0.001 * distance(paris, ab);
+ double d11 = 0.001 * distance(paris, ab, vincenty<point_ll_deg, point_ll_deg>());
+ double d12 = 0.001 * distance(ab, paris, vincenty<point_ll_deg, point_ll_deg>());
+ std::cout << "Distances: " << d9 << " == " << d10 << " == " << d11 << " == " << d12 << std::endl;
+
+ // TODO: solve this case, it is reversed -> strategy should be reversed as well
+ // For this, first implement that linestring can have other coor.sys then point type...
+ //double d13 = 0.001 * distance(ab, paris_rad, vincenty<point_ll_deg, point_ll_rad>());
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/distance_mixed.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/distance_mixed.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="distance_mixed"
+ ProjectGUID="{F287EAF6-6F4F-4F7A-92DF-3CA4F71B0948}"
+ RootNamespace="distance_mixed"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\distance_mixed"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\distance_mixed"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\distance_mixed.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/latlong.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/latlong.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,50 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "area_ll", "area_ll.vcproj", "{BA69A6CC-52F0-45AD-A43E-00FE3416F8C5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_ll", "point_ll.vcproj", "{8376897F-30E1-43B5-8332-930A1F807BCB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distance_mixed", "distance_mixed.vcproj", "{F287EAF6-6F4F-4F7A-92DF-3CA4F71B0948}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "andoyer", "andoyer.vcproj", "{CE0ECB77-1772-4F74-AB74-79C43CC3FD27}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parse_dms", "parse_dms.vcproj", "{A924B132-C216-4477-85EE-9118255011AA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parse", "parse.vcproj", "{38C7173B-F81D-427D-B236-57611A31656A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BA69A6CC-52F0-45AD-A43E-00FE3416F8C5}.Debug|Win32.ActiveCfg = Debug|Win32
+ {BA69A6CC-52F0-45AD-A43E-00FE3416F8C5}.Debug|Win32.Build.0 = Debug|Win32
+ {BA69A6CC-52F0-45AD-A43E-00FE3416F8C5}.Release|Win32.ActiveCfg = Release|Win32
+ {BA69A6CC-52F0-45AD-A43E-00FE3416F8C5}.Release|Win32.Build.0 = Release|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Debug|Win32.Build.0 = Debug|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Release|Win32.ActiveCfg = Release|Win32
+ {8376897F-30E1-43B5-8332-930A1F807BCB}.Release|Win32.Build.0 = Release|Win32
+ {F287EAF6-6F4F-4F7A-92DF-3CA4F71B0948}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F287EAF6-6F4F-4F7A-92DF-3CA4F71B0948}.Debug|Win32.Build.0 = Debug|Win32
+ {F287EAF6-6F4F-4F7A-92DF-3CA4F71B0948}.Release|Win32.ActiveCfg = Release|Win32
+ {F287EAF6-6F4F-4F7A-92DF-3CA4F71B0948}.Release|Win32.Build.0 = Release|Win32
+ {CE0ECB77-1772-4F74-AB74-79C43CC3FD27}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CE0ECB77-1772-4F74-AB74-79C43CC3FD27}.Debug|Win32.Build.0 = Debug|Win32
+ {CE0ECB77-1772-4F74-AB74-79C43CC3FD27}.Release|Win32.ActiveCfg = Release|Win32
+ {CE0ECB77-1772-4F74-AB74-79C43CC3FD27}.Release|Win32.Build.0 = Release|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Debug|Win32.Build.0 = Debug|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Release|Win32.ActiveCfg = Release|Win32
+ {A924B132-C216-4477-85EE-9118255011AA}.Release|Win32.Build.0 = Release|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Debug|Win32.Build.0 = Debug|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Release|Win32.ActiveCfg = Release|Win32
+ {38C7173B-F81D-427D-B236-57611A31656A}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,64 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <string>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/parse.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp>
+
+#include <test_common/test_point.hpp>
+
+using namespace boost::geometry;
+
+template <typename P>
+void test_2d(double c, bool use_strategy)
+{
+ // normal order, east=x, north=y
+ P p;
+ parse(p, std::string("1dE"), std::string("2N"));
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 1 * c, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 2 * c, 1.0e-6);
+
+ // reversed order, y,x -> should be interpreted correctly
+ parse(p, std::string("1dN"), std::string("2E"));
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 2 * c, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) 1 * c, 1.0e-6);
+
+ if (use_strategy)
+ {
+ // DUTCH system NOZW, only for degrees
+ boost::geometry::strategy::dms_parser<false, 'N', 'O', 'Z', 'W'> strategy;
+ parse(p, std::string("1dO"), std::string("2Z"), strategy);
+ BOOST_CHECK_CLOSE( ((double) get<0>(p)), (double) 1, 1.0e-6);
+ BOOST_CHECK_CLOSE( ((double) get<1>(p)), (double) -2, 1.0e-6);
+ }
+
+ // rest of DMS is checked in parse_dms
+}
+
+template <typename T, typename P>
+void test_3d()
+{
+}
+
+int test_main(int, char* [])
+{
+ //test_2d<point<int, 2, cs::geographic<radian> > >();
+ //test_2d<point<float, 2, cs::geographic<radian> > >();
+
+ test_2d<point<double, 2, cs::geographic<degree> > >(1.0, true);
+ test_2d<point<double, 2, cs::geographic<radian> > >(boost::geometry::math::d2r, false);
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="parse"
+ ProjectGUID="{38C7173B-F81D-427D-B236-57611A31656A}"
+ RootNamespace="parse"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\parse.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse_dms.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse_dms.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,118 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or parse_dms at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#include <string>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp>
+
+
+
+void check(const boost::geometry::dms_result& r, double v, int axis)
+{
+ const double d = r;
+ BOOST_CHECK_CLOSE(d, v, 0.0001);
+ BOOST_CHECK(int(r.axis()) == axis);
+}
+
+template <bool as_radian>
+void test_dms(const std::string& s, double v, int axis)
+{
+ boost::geometry::strategy::dms_parser<as_radian> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+template <bool as_radian>
+void test_dms_french(const std::string& s, double v, int axis)
+{
+ boost::geometry::strategy::dms_parser<as_radian, 'N', 'E', 'S', 'O'> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+template <bool as_radian>
+void test_dms_dutch(const std::string& s, double v, int axis)
+{
+ boost::geometry::strategy::dms_parser<as_radian, 'N', 'O', 'Z', 'W'> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+template <bool as_radian>
+void test_dms_case(const std::string& s, double v, int axis)
+{
+ boost::geometry::strategy::dms_parser<as_radian, 'n', 'e', 's', 'w'> parser;
+ check(parser(s.c_str()), v, axis);
+}
+
+int test_main(int, char* [])
+{
+ test_dms<false>("5.9E", 5.9, 0);
+ test_dms<false>("5.9W", -5.9, 0);
+ test_dms<false>("5.9N", 5.9, 1);
+ test_dms<false>("5.9S", -5.9, 1);
+
+ // nearly pi -> nearly 180
+ test_dms<false>("3.14RE", 179.90874767107848755314620611629, 0);
+
+ test_dms<false>("5.9dE", 5.9, 0);
+ test_dms<false>("5.9dW", -5.9, 0);
+ test_dms<false>("5.9dN", 5.9, 1);
+ test_dms<false>("5.9dS", -5.9, 1);
+
+ // with minutes
+ test_dms<false>("5d15E", 5.25, 0);
+ test_dms<false>("5d30W", -5.50, 0);
+ test_dms<false>("5d45N", 5.75, 1);
+ test_dms<false>("5d00S", -5.00, 1);
+
+ // with minutes and indicator
+ test_dms<false>("5d15'E", 5.25, 0);
+ test_dms<false>("5d30'W", -5.50, 0);
+ test_dms<false>("5d45'N", 5.75, 1);
+ test_dms<false>("5d00'S", -5.00, 1);
+
+ // with minutes/seconds
+ test_dms<false>("5d10'05E", 5.168055, 0);
+ test_dms<false>("5d20'15W", -5.33750, 0);
+ test_dms<false>("5d30'25N", 5.5069444, 1);
+ test_dms<false>("5d40'35S", -5.676389, 1);
+
+ // with seconds only
+ double f3600 = 1/3600.0;
+ test_dms<false>("5d01\"E", 5 + f3600, 0);
+ test_dms<false>("5d02\"W", -(5 + 2.0 * f3600), 0);
+ test_dms<false>("5d03\"N", 5 + 3.0 * f3600, 1);
+ test_dms<false>("5d04\"S", -(5 + 4.0 * f3600), 1);
+
+ // with spaces, signs, etc etc
+ test_dms<false>("5d 10' 05\" E", 5.168055, 0);
+ test_dms<false>("+5d 10' 05\" E", 5.168055, 0);
+ test_dms<false>("-5d 10' 05\" E", -5.168055, 0);
+
+ // reversed orders and default
+ test_dms<false>("5d 05\" 10' E", 5.168055, 0);
+ test_dms<false>("E5 05\" 10' ", 5.168055, 0);
+ test_dms<false>("5", 5, 0);
+
+ // in radians
+ test_dms<true>("3.14RE", 3.14, 0);
+ test_dms<true>("3.14RW", -3.14, 0);
+
+ // other languages
+ test_dms_french<false>("52O", -52, 0);
+ test_dms_dutch <false>("52O", +52, 0);
+
+ // lower/upper case
+ test_dms<false>("52e", 52, 0);
+ test_dms_case<false>("52e", 52, 0);
+ test_dms_case<false>("52E", 52, 0);
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse_dms.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/parse_dms.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="parse_dms"
+ ProjectGUID="{A924B132-C216-4477-85EE-9118255011AA}"
+ RootNamespace="parse_dms"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse_dms"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\parse_dms"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\parse_dms.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/point_ll.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/point_ll.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,76 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/transform.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/stream_wkt.hpp>
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/extensions/gis/latlong/point_ll.hpp>
+
+
+#include <test_common/test_point.hpp>
+
+template <typename P>
+void test_all()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type type;
+
+ P p1(boost::geometry::latitude<type>(boost::geometry::dms<boost::geometry::south, type>(12, 2, 36)),
+ boost::geometry::longitude<type>(boost::geometry::dms<boost::geometry::west, type>(77, 1, 42)));
+
+ // Check decimal/degree conversion
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(p1), type(-77.0283), 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(p1), type(-12.0433), 0.001);
+
+ // Check degree/radian conversion
+ boost::geometry::point_ll<type, boost::geometry::cs::geographic<boost::geometry::radian> > p2;
+ boost::geometry::transform(p1, p2);
+
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(p2), type(-1.3444), 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(p2), type(-0.210196), 0.001);
+
+ // Check degree/radian conversion back
+ P p3;
+ boost::geometry::transform(p2, p3);
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(p3), type(-77.0283), 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(p3), type(-12.0433), 0.001);
+
+
+ // Check decimal/degree conversion back
+ int d;
+ int m;
+ double s;
+ bool positive;
+ char cardinal;
+
+ boost::geometry::dms<boost::geometry::cd_lat, type> d1(boost::geometry::get<0>(p3));
+ d1.get_dms(d, m, s, positive, cardinal);
+
+ BOOST_CHECK(d == 77);
+ BOOST_CHECK(m == 1);
+ BOOST_CHECK_CLOSE(s, double(42), 0.1);
+ BOOST_CHECK(positive == false);
+ BOOST_CHECK(cardinal == 'S');
+
+ // Check dd conversion as string, back. We cannot do that always because of the precision.
+ // Only double gives correct results
+ //std::string st = d1.get_dms();
+ //std::cout << st << std::endl;
+ //BOOST_CHECK(st == "77 1'42\" S");
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_ll<float> >();
+ test_all<boost::geometry::point_ll<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/latlong/point_ll.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/latlong/point_ll.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="point_ll"
+ ProjectGUID="{8376897F-30E1-43B5-8332-930A1F807BCB}"
+ RootNamespace="point_ll"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\point_ll"
+ InheritedPropertySheets="../../../boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\point_ll"
+ InheritedPropertySheets="../../../boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\point_ll.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,77 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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
+#pragma warning( disable : 4244 ) // loss of data
+#endif // defined(_MSC_VER)
+
+
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/gis/projections/parameters.hpp>
+#include <boost/geometry/extensions/gis/projections/projection.hpp>
+#include <boost/geometry/extensions/gis/projections/proj/aea.hpp>
+
+#include <boost/geometry/algorithms/transform.hpp>
+#include <boost/geometry/core/coordinate_type.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array.hpp>
+#include <boost/geometry/extensions/gis/latlong/point_ll.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename Prj, typename P1, typename P2>
+void test_one(double lon, double lat,
+ typename boost::geometry::coordinate_type<P2>::type x,
+ typename boost::geometry::coordinate_type<P2>::type y,
+ const std::string& parameters)
+{
+ boost::geometry::projection::parameters par = boost::geometry::projection::detail::pj_init_plus(parameters);
+ Prj prj(par);
+
+ P1 ll;
+ ll.lon(lon);
+ ll.lat(lat);
+
+ P2 xy;
+ prj.forward(ll, xy);
+
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(xy), x, 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(xy), y, 0.001);
+}
+
+template <typename P>
+void test_all()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coord_type;
+ typedef boost::geometry::point_ll<coord_type, boost::geometry::cs::geographic<boost::geometry::degree> > point_type;
+
+ // aea
+ test_one<boost::geometry::projection::aea_ellipsoid<point_type, P>, point_type, P>
+ (4.897000, 52.371000, 334609.583974, 5218502.503686,
+ "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65");
+}
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test::test_point>();
+ //test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+ test_all<boost::geometry::point_xy<long double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="projection"
+ ProjectGUID="{A46D98E8-88F2-4795-B839-CD3F6082E7B2}"
+ RootNamespace="projection"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\projection.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection_epsg.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection_epsg.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,87 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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
+#pragma warning( disable : 4244 ) // loss of data
+#endif // defined(_MSC_VER)
+
+
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/gis/projections/parameters.hpp>
+#include <boost/geometry/extensions/gis/projections/projection.hpp>
+#include <boost/geometry/extensions/gis/projections/proj/sterea.hpp>
+#include <boost/geometry/extensions/gis/projections/proj/tmerc.hpp>
+
+
+#include <boost/geometry/algorithms/transform.hpp>
+
+#include <boost/geometry/core/coordinate_type.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/extensions/gis/latlong/point_ll.hpp>
+#include <test_common/test_point.hpp>
+
+template <int E, typename P1, typename P2>
+void test_one(double lon, double lat,
+ typename boost::geometry::coordinate_type<P2>::type x,
+ typename boost::geometry::coordinate_type<P2>::type y)
+{
+ typedef typename boost::geometry::coordinate_type<P2>::type coord_type;
+
+ typedef boost::geometry::projection::epsg_traits<E, P1, P2> epsg_traits;
+ boost::geometry::projection::parameters par = boost::geometry::projection::detail::pj_init_plus(epsg_traits::par());
+
+ typedef typename epsg_traits::type prj_type;
+ prj_type prj(par);
+
+ P1 ll;
+ ll.lon(lon);
+ ll.lat(lat);
+
+ P2 xy;
+ prj.forward(ll, xy);
+
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(xy), x, 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(xy), y, 0.001);
+}
+
+template <typename D, typename P>
+void test_deg_rad(double factor)
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coord_type;
+ typedef boost::geometry::point_ll<coord_type, boost::geometry::cs::geographic<D> > point_type;
+
+ test_one<28992, point_type, P>(4.897000 * factor, 52.371000 * factor, 121590.388077, 487013.903377);
+ test_one<29118, point_type, P>(4.897000 * factor, 52.371000 * factor, 4852882, 9129373);
+}
+
+template <typename P>
+void test_all()
+{
+ test_deg_rad<boost::geometry::degree, P>(1.0);
+ test_deg_rad<boost::geometry::radian, P>(boost::geometry::math::d2r);
+}
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test::test_point>();
+ //test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+ test_all<boost::geometry::point_xy<long double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection_epsg.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projection_epsg.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="projection_epsg"
+ ProjectGUID="{06E9D20E-FF21-4245-89B4-04387F0F0DCC}"
+ RootNamespace="projection_epsg"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection_epsg"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projection_epsg"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\projection_epsg.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,355 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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
+#pragma warning( disable : 4244 ) // loss of data
+#pragma warning( disable : 4996 ) // loss of data
+#endif // defined(_MSC_VER)
+
+
+#include <sstream>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/gis/projections/parameters.hpp>
+#include <boost/geometry/extensions/gis/projections/projection.hpp>
+#include <boost/geometry/extensions/gis/projections/factory.hpp>
+
+#include <boost/geometry/algorithms/transform.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array.hpp>
+#include <boost/geometry/extensions/gis/latlong/point_ll.hpp>
+#include <test_common/test_point.hpp>
+
+
+inline void check(double v, double ve, std::string const& name, std::string const& axis)
+{
+ if (! boost::test_tools::check_is_close(v, ve, boost::test_tools::percent_tolerance(0.001)))
+ {
+ std::ostringstream out;
+ out << "\n" << name << " " << axis << " -> " << v << " != " << ve;
+ BOOST_ERROR(out.str());
+ }
+
+}
+
+template <typename P>
+void test_forward(std::string const& name,
+ double lon, double lat,
+ typename boost::geometry::coordinate_type<P>::type x,
+ typename boost::geometry::coordinate_type<P>::type y,
+ const std::string& parameters)
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coord_type;
+ typedef boost::geometry::point_ll<coord_type, boost::geometry::cs::geographic<boost::geometry::degree> > lonlat_type;
+
+ lonlat_type ll;
+ ll.lon(lon);
+ ll.lat(lat);
+
+ boost::geometry::projection::parameters params = boost::geometry::projection::detail::pj_init_plus(parameters);
+ boost::geometry::projection::factory<lonlat_type, P, boost::geometry::projection::parameters> pf;
+
+ boost::shared_ptr<boost::geometry::projection::projection<lonlat_type, P> > prj(pf.create_new(params));
+
+ P xy;
+ prj->forward(ll, xy);
+
+ //std::cout << std::setprecision(16) << boost::geometry::get<0>(xy) << " " << boost::geometry::get<1>(xy) << std::endl;
+
+ check(boost::geometry::get<0>(xy), x, name, "x");
+ check(boost::geometry::get<1>(xy), y, name, "y");
+}
+
+template <typename P>
+void test_inverse(std::string const& name,
+ typename boost::geometry::coordinate_type<P>::type x,
+ typename boost::geometry::coordinate_type<P>::type y,
+ double lon, double lat,
+ const std::string& parameters)
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coord_type;
+ typedef boost::geometry::point_ll<coord_type, boost::geometry::cs::geographic<boost::geometry::degree> > lonlat_type;
+
+ P xy;
+ boost::geometry::set<0>(xy, x);
+ boost::geometry::set<1>(xy, y);
+
+ boost::geometry::projection::parameters params = boost::geometry::projection::detail::pj_init_plus(parameters);
+ boost::geometry::projection::factory<lonlat_type, P, boost::geometry::projection::parameters> pf;
+
+ boost::shared_ptr<boost::geometry::projection::projection<lonlat_type, P> > prj(pf.create_new(params));
+
+ lonlat_type ll;
+ prj->inverse(xy, ll);
+
+ //std::cout << std::setprecision(16) << boost::geometry::get<0>(ll) << " " << boost::geometry::get<1>(ll) << std::endl;
+
+ check(boost::geometry::get<0>(ll), lon, name, "lon");
+ check(boost::geometry::get<1>(ll), lat, name, "lat");
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_forward<P>("aea", 4.897000, 52.371000, 334609.583974, 5218502.503686, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65");
+ test_forward<P>("aeqd", 4.897000, 52.371000, 384923.723428, 5809986.497118, "+proj=aeqd +ellps=WGS84 +units=m");
+ test_forward<P>("airy", 4.897000, 52.371000, 328249.003313, 4987937.101447, "+proj=airy +ellps=WGS84 +units=m");
+ test_forward<P>("aitoff", 4.897000, 52.371000, 384096.182830, 5831239.274680, "+proj=aitoff +ellps=WGS84 +units=m");
+ test_forward<P>("alsk", -84.390000, 33.755000, 7002185.416415, -3700467.546545, "+proj=alsk +ellps=WGS84 +units=m +lon_0=-150W");
+ test_forward<P>("apian", 4.897000, 52.371000, -489503.746852, 5829913.052335, "+proj=apian +ellps=WGS84 +units=m +lon_0=11d32'00E");
+ test_forward<P>("august", 4.897000, 52.371000, 472494.816642, 6557137.075680, "+proj=august +ellps=WGS84 +units=m");
+ test_forward<P>("bacon", 4.897000, 52.371000, -276322.940590, 7934660.138798, "+proj=bacon +ellps=WGS84 +units=m +lon_0=11d32'00E");
+ test_forward<P>("bipc", 4.897000, 52.371000, 3693973.674143, -8459972.647559, "+proj=bipc +ellps=WGS84 +units=m");
+ test_forward<P>("boggs", 4.897000, 52.371000, -469734.523784, 5966441.169806, "+proj=boggs +ellps=WGS84 +units=m +lon_0=11d32'00E");
+ test_forward<P>("bonne", 4.897000, 52.371000, 333291.091896, 274683.016972, "+proj=bonne +ellps=WGS84 +units=m +lat_1=50");
+ test_forward<P>("cass", 4.897000, 52.371000, 333274.431072, 5815921.803069, "+proj=cass +ellps=WGS84 +units=m");
+ test_forward<P>("cc", 4.897000, 52.371000, 545131.546415, 8273513.720038, "+proj=cc +ellps=WGS84 +units=m");
+ test_forward<P>("cea", 4.897000, 52.371000, -738753.247401, 5031644.669407, "+proj=cea +ellps=WGS84 +units=m +lon_0=11d32'00E");
+ test_forward<P>("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<P>("collg", 4.897000, 52.371000, 280548.640940, 6148862.475491, "+proj=collg +ellps=WGS84 +units=m");
+ test_forward<P>("crast", 4.897000, 52.371000, 340944.220871, 5874029.522010, "+proj=crast +ellps=WGS84 +units=m");
+ test_forward<P>("denoy", 4.897000, 52.371000, 382253.324398, 5829913.052335, "+proj=denoy +ellps=WGS84 +units=m");
+ test_forward<P>("eck1", 4.897000, 52.371000, 356112.818167, 5371202.270688, "+proj=eck1 +ellps=WGS84 +units=m");
+ test_forward<P>("eck2", 4.897000, 52.371000, 320023.223588, 6697754.654662, "+proj=eck2 +ellps=WGS84 +units=m");
+ test_forward<P>("eck3", 4.897000, 52.371000, 417367.858470, 4923223.990430, "+proj=eck3 +ellps=WGS84 +units=m");
+ test_forward<P>("eck4", 4.897000, 52.371000, 383678.300021, 6304427.033917, "+proj=eck4 +ellps=WGS84 +units=m");
+ test_forward<P>("eck5", 4.897000, 52.371000, 387191.346304, 5142132.228246, "+proj=eck5 +ellps=WGS84 +units=m");
+ test_forward<P>("eck6", 4.897000, 52.371000, 342737.885307, 6363364.830847, "+proj=eck6 +ellps=WGS84 +units=m");
+ test_forward<P>("eqc", 4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=eqc +ellps=WGS84 +units=m");
+ test_forward<P>("eqdc", 4.897000, 52.371000, 307874.536263, 5810915.646438, "+proj=eqdc +ellps=WGS84 +units=m +lat_1=60 +lat_2=0");
+ test_forward<P>("euler", 4.897000, 52.371000, 338753.024859, 5836825.984893, "+proj=euler +ellps=WGS84 +units=m +lat_1=60 +lat_2=0");
+ test_forward<P>("fahey", 4.897000, 52.371000, 388824.354103, 5705638.873094, "+proj=fahey +ellps=WGS84 +units=m");
+ test_forward<P>("fouc", 4.897000, 52.371000, 268017.369817, 6272855.564674, "+proj=fouc +ellps=WGS84 +units=m");
+ test_forward<P>("fouc_s", 4.897000, 52.371000, 545131.546415, 5051361.531375, "+proj=fouc_s +ellps=WGS84 +units=m");
+ test_forward<P>("gall", 4.897000, 52.371000, 385466.213109, 5354217.135929, "+proj=gall +ellps=WGS84 +units=m");
+ test_forward<P>("geocent", 4.897000, 52.371000, 545131.546415, 5829913.052335, "+proj=geocent +ellps=WGS84 +units=m");
+ test_forward<P>("geos", 4.897000, 52.371000, 313594.638994, 4711397.361812, "+proj=geos +ellps=WGS84 +units=m +h=40000000");
+ test_forward<P>("gins8", 4.897000, 52.371000, 409919.989781, 6235811.415629, "+proj=gins8 +ellps=WGS84 +units=m");
+ test_forward<P>("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<P>("gnom", 4.897000, 52.371000, 546462.815658, 8303824.612633, "+proj=gnom +ellps=WGS84 +units=m");
+ test_forward<P>("goode", 4.897000, 52.371000, 360567.451176, 5782693.787691, "+proj=goode +ellps=WGS84 +units=m");
+ test_forward<P>("gs48", -84.390000, 33.755000, 4904886.323054, 12421187.782392, "+proj=gs48 +ellps=WGS84 +units=m +lon1=-48");
+ test_forward<P>("gs50", -84.390000, 33.755000, 3190310.148850, -564230.076744, "+proj=gs50 +ellps=WGS84 +units=m +lon1=-50");
+ test_forward<P>("gstmerc", 4.897000, 52.371000, 333173.875017, 5815062.181746, "+proj=gstmerc +ellps=WGS84 +units=m");
+ test_forward<P>("hammer", 4.897000, 52.371000, 370843.923425, 5630047.232233, "+proj=hammer +ellps=WGS84 +units=m");
+ test_forward<P>("hatano", 4.897000, 52.371000, 383644.128560, 6290117.704632, "+proj=hatano +ellps=WGS84 +units=m");
+ test_forward<P>("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<P>("kav5", 4.897000, 52.371000, 383646.088858, 5997047.888175, "+proj=kav5 +ellps=WGS84 +units=m");
+ test_forward<P>("kav7", 4.897000, 52.371000, 407769.043907, 5829913.052335, "+proj=kav7 +ellps=WGS84 +units=m");
+ test_forward<P>("krovak", 14.416667, 50.083333, -743286.779768, -1043498.912060, "+proj=krovak +ellps=WGS84 +units=m");
+ test_forward<P>("laea", 4.897000, 52.371000, 371541.476735, 5608007.251007, "+proj=laea +ellps=WGS84 +units=m");
+ test_forward<P>("lagrng", 4.897000, 52.371000, 413379.673720, 6281547.821085, "+proj=lagrng +ellps=WGS84 +units=m +W=1");
+ test_forward<P>("larr", 4.897000, 52.371000, 485541.716273, 6497324.523196, "+proj=larr +ellps=WGS84 +units=m");
+ test_forward<P>("lask", 4.897000, 52.371000, 456660.618715, 6141427.377857, "+proj=lask +ellps=WGS84 +units=m");
+ test_forward<P>("latlon", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlon +ellps=WGS84 +units=m");
+ test_forward<P>("latlong", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=latlong +ellps=WGS84 +units=m");
+ test_forward<P>("lcc", 4.897000, 52.371000, 319700.820572, 5828852.504871, "+proj=lcc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_forward<P>("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<P>("leac", 4.897000, 52.371000, 249343.870798, 6909632.226405, "+proj=leac +ellps=WGS84 +units=m");
+ test_forward<P>("lee_os", -84.390000, 33.755000, 7657412.020774, 4716426.185485, "+proj=lee_os +ellps=WGS84 +units=m");
+ test_forward<P>("longlat", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=longlat +ellps=WGS84 +units=m");
+ test_forward<P>("lonlat", 4.897000, 52.371000, 0.085469, 0.914046, "+proj=lonlat +ellps=WGS84 +units=m");
+ test_forward<P>("loxim", 4.897000, 52.371000, 462770.371742, 5829913.052335, "+proj=loxim +ellps=WGS84 +units=m");
+ test_forward<P>("lsat", -84.390000, 33.755000, 16342543.294793, -2092348.169198, "+proj=lsat +ellps=WGS84 +units=m +lsat=1 +path=1");
+ test_forward<P>("mbt_fps", 4.897000, 52.371000, 392815.792409, 6007058.470101, "+proj=mbt_fps +ellps=WGS84 +units=m");
+ test_forward<P>("mbt_s", 4.897000, 52.371000, 389224.301381, 5893467.204064, "+proj=mbt_s +ellps=WGS84 +units=m");
+ test_forward<P>("mbtfpp", 4.897000, 52.371000, 345191.582111, 6098551.031494, "+proj=mbtfpp +ellps=WGS84 +units=m");
+ test_forward<P>("mbtfpq", 4.897000, 52.371000, 371214.469979, 5901319.366034, "+proj=mbtfpq +ellps=WGS84 +units=m");
+ test_forward<P>("mbtfps", 4.897000, 52.371000, 325952.066750, 6266156.827884, "+proj=mbtfps +ellps=WGS84 +units=m");
+ test_forward<P>("merc", 4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=merc +ellps=WGS84 +units=m");
+ test_forward<P>("mil_os", 4.897000, 52.371000, -1017212.552960, 3685935.358004, "+proj=mil_os +ellps=WGS84 +units=m");
+ test_forward<P>("mill", 4.897000, 52.371000, 545131.546415, 6431916.372717, "+proj=mill +ellps=WGS84 +units=m");
+ test_forward<P>("moll", 4.897000, 52.371000, 360567.451176, 6119459.421291, "+proj=moll +ellps=WGS84 +units=m");
+ test_forward<P>("murd1", 4.897000, 52.371000, 333340.993642, 5839071.944597, "+proj=murd1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_forward<P>("murd2", 4.897000, 52.371000, 317758.821713, 6759296.097305, "+proj=murd2 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_forward<P>("murd3", 4.897000, 52.371000, 331696.409000, 5839224.186916, "+proj=murd3 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_forward<P>("nell", 4.897000, 52.371000, 454576.246081, 5355027.851999, "+proj=nell +ellps=WGS84 +units=m");
+ test_forward<P>("nell_h", 4.897000, 52.371000, 438979.742911, 5386970.539995, "+proj=nell_h +ellps=WGS84 +units=m");
+ test_forward<P>("nicol", 4.897000, 52.371000, 360493.071000, 5836451.532406, "+proj=nicol +ellps=WGS84 +units=m");
+ test_forward<P>("nsper", 4.897000, 52.371000, 0.521191, 7.919806, "+proj=nsper +ellps=WGS84 +units=m +a=10 +h=40000000");
+ test_forward<P>("nzmg", 174.783333, -36.850000, 2669448.884228, 6482177.102194, "+proj=nzmg +ellps=WGS84 +units=m");
+ test_forward<P>("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<P>("ocea", 4.897000, 52.371000, 90368744555736.703000, -5887882801731.769500, "+proj=ocea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e");
+ test_forward<P>("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<P>("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<P>("ortel", 4.897000, 52.371000, 360906.947408, 5829913.052335, "+proj=ortel +ellps=WGS84 +units=m");
+ test_forward<P>("ortho", 4.897000, 52.371000, 332422.874291, 5051361.531375, "+proj=ortho +ellps=WGS84 +units=m");
+ test_forward<P>("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<P>("poly", 4.897000, 52.371000, 333274.269648, 5815908.957562, "+proj=poly +ellps=WGS84 +units=m");
+ test_forward<P>("putp1", 4.897000, 52.371000, 375730.931178, 5523551.121434, "+proj=putp1 +ellps=WGS84 +units=m");
+ test_forward<P>("putp2", 4.897000, 52.371000, 351480.997939, 5942668.547355, "+proj=putp2 +ellps=WGS84 +units=m");
+ test_forward<P>("putp3", 4.897000, 52.371000, 287673.972013, 4651597.610600, "+proj=putp3 +ellps=WGS84 +units=m");
+ test_forward<P>("putp3p", 4.897000, 52.371000, 361313.008033, 4651597.610600, "+proj=putp3p +ellps=WGS84 +units=m");
+ test_forward<P>("putp4p", 4.897000, 52.371000, 351947.465829, 6330828.716145, "+proj=putp4p +ellps=WGS84 +units=m");
+ test_forward<P>("putp5", 4.897000, 52.371000, 320544.316171, 5908383.682019, "+proj=putp5 +ellps=WGS84 +units=m");
+ test_forward<P>("putp5p", 4.897000, 52.371000, 436506.666600, 5908383.682019, "+proj=putp5p +ellps=WGS84 +units=m");
+ test_forward<P>("putp6", 4.897000, 52.371000, 324931.055842, 5842588.644796, "+proj=putp6 +ellps=WGS84 +units=m");
+ test_forward<P>("putp6p", 4.897000, 52.371000, 338623.512107, 6396742.919679, "+proj=putp6p +ellps=WGS84 +units=m");
+ test_forward<P>("qua_aut", 4.897000, 52.371000, 370892.621714, 5629072.862494, "+proj=qua_aut +ellps=WGS84 +units=m");
+ test_forward<P>("robin", 4.897000, 52.371000, 394576.507489, 5571243.439235, "+proj=robin +ellps=WGS84 +units=m");
+ test_forward<P>("rouss", 4.897000, 52.371000, 412826.227669, 6248368.849775, "+proj=rouss +ellps=WGS84 +units=m");
+ test_forward<P>("rpoly", 4.897000, 52.371000, 332447.130797, 5841164.662431, "+proj=rpoly +ellps=WGS84 +units=m");
+ test_forward<P>("sinu", 4.897000, 52.371000, 333528.909809, 5804625.044313, "+proj=sinu +ellps=WGS84 +units=m");
+ test_forward<P>("somerc", 4.897000, 52.371000, 545131.546415, 6833623.829215, "+proj=somerc +ellps=WGS84 +units=m");
+ test_forward<P>("stere", 4.897000, 52.371000, 828919.243654, 12511653.499743, "+proj=stere +ellps=WGS84 +units=m +lat_ts=30n");
+ test_forward<P>("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<P>("tcc", 4.897000, 52.371000, 332875.293370, 5841186.022551, "+proj=tcc +ellps=WGS84 +units=m");
+ test_forward<P>("tcea", 4.897000, 52.371000, 332422.874291, 5841186.022551, "+proj=tcea +ellps=WGS84 +units=m");
+ test_forward<P>("tissot", 4.897000, 52.371000, 431443.972539, 3808494.480735, "+proj=tissot +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_forward<P>("tmerc", 4.897000, 52.371000, 333425.492136, 5815921.814396, "+proj=tmerc +ellps=WGS84 +units=m");
+ test_forward<P>("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<P>("tpers", 4.897000, 52.371000, -1172311.936260, 6263306.090352, "+proj=tpers +ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000");
+ test_forward<P>("ups", 4.897000, 52.371000, 2369508.503532, -2312783.579527, "+proj=ups +ellps=WGS84 +units=m");
+ test_forward<P>("urm5", 4.897000, 52.371000, 522185.854469, 5201544.371625, "+proj=urm5 +ellps=WGS84 +units=m +n=.3 +q=.3 +alpha=10");
+ test_forward<P>("urmfps", 4.897000, 52.371000, 439191.083465, 5919500.887257, "+proj=urmfps +ellps=WGS84 +units=m +n=0.50");
+ test_forward<P>("utm", 4.897000, 52.371000, 220721.998929, 5810228.672907, "+proj=utm +ellps=WGS84 +units=m +lon_0=11d32'00E");
+ test_forward<P>("vandg", 4.897000, 52.371000, 489005.929978, 6431581.024949, "+proj=vandg +ellps=WGS84 +units=m");
+ test_forward<P>("vandg2", 4.897000, 52.371000, 488953.592205, 6434578.861895, "+proj=vandg2 +ellps=WGS84 +units=m");
+ test_forward<P>("vandg3", 4.897000, 52.371000, 489028.113123, 6430309.983824, "+proj=vandg3 +ellps=WGS84 +units=m");
+ test_forward<P>("vandg4", 4.897000, 52.371000, 360804.549444, 5831531.435618, "+proj=vandg4 +ellps=WGS84 +units=m");
+ test_forward<P>("vitk1", 4.897000, 52.371000, 338522.044182, 5839611.656064, "+proj=vitk1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_forward<P>("wag1", 4.897000, 52.371000, 348059.961742, 6344311.295111, "+proj=wag1 +ellps=WGS84 +units=m");
+ test_forward<P>("wag2", 4.897000, 52.371000, 388567.174132, 6112322.636203, "+proj=wag2 +ellps=WGS84 +units=m");
+ test_forward<P>("wag3", 4.897000, 52.371000, 447014.436776, 5829913.052335, "+proj=wag3 +ellps=WGS84 +units=m");
+ test_forward<P>("wag4", 4.897000, 52.371000, 365021.547713, 6300040.998324, "+proj=wag4 +ellps=WGS84 +units=m");
+ test_forward<P>("wag5", 4.897000, 52.371000, 379647.914735, 6771982.379506, "+proj=wag5 +ellps=WGS84 +units=m");
+ test_forward<P>("wag6", 4.897000, 52.371000, 446107.907415, 5523551.121434, "+proj=wag6 +ellps=WGS84 +units=m");
+ test_forward<P>("wag7", 4.897000, 52.371000, 366407.198644, 6169832.906560, "+proj=wag7 +ellps=WGS84 +units=m");
+ test_forward<P>("weren", 4.897000, 52.371000, 402668.037596, 7243190.025762, "+proj=weren +ellps=WGS84 +units=m");
+ test_forward<P>("wink1", 4.897000, 52.371000, 438979.742911, 5829913.052335, "+proj=wink1 +ellps=WGS84 +units=m");
+ test_forward<P>("wink2", 4.897000, 52.371000, 472810.645318, 6313461.757868, "+proj=wink2 +ellps=WGS84 +units=m");
+ test_forward<P>("wintri", 4.897000, 52.371000, 365568.851909, 5830576.163507, "+proj=wintri +ellps=WGS84 +units=m");
+
+ test_inverse<P>("aea", 334609.583974, 5218502.503686, 4.897000, 52.371000, "+proj=aea +ellps=WGS84 +units=m +lat_1=55 +lat_2=65");
+ test_inverse<P>("aeqd", 384923.723428, 5809986.497118, 4.898398, 52.378890, "+proj=aeqd +ellps=WGS84 +units=m"); // F/I: 883.080918
+ test_inverse<P>("alsk", 7002185.416415, -3700467.546545, -84.389819, 33.754911, "+proj=alsk +ellps=WGS84 +units=m +lon_0=-150W"); // F/I: 19.398478
+ test_inverse<P>("bipc", 3693973.674143, -8459972.647559, 4.897000, 52.371000, "+proj=bipc +ellps=WGS84 +units=m");
+ test_inverse<P>("bonne", 333291.091896, 274683.016972, 4.897000, 52.371000, "+proj=bonne +ellps=WGS84 +units=m +lat_1=50");
+ test_inverse<P>("cass", 333274.431072, 5815921.803069, 4.897007, 52.371001, "+proj=cass +ellps=WGS84 +units=m"); // F/I: 0.460628
+ test_inverse<P>("cc", 545131.546415, 8273513.720038, 4.897000, 52.371000, "+proj=cc +ellps=WGS84 +units=m");
+ test_inverse<P>("cea", -738753.247401, 5031644.669407, 4.897000, 52.371000, "+proj=cea +ellps=WGS84 +units=m +lon_0=11d32'00E");
+ test_inverse<P>("collg", 280548.640940, 6148862.475491, 4.897000, 52.371000, "+proj=collg +ellps=WGS84 +units=m");
+ test_inverse<P>("crast", 340944.220871, 5874029.522010, 4.897000, 52.371000, "+proj=crast +ellps=WGS84 +units=m");
+ test_inverse<P>("eck1", 356112.818167, 5371202.270688, 4.897000, 52.371000, "+proj=eck1 +ellps=WGS84 +units=m");
+ test_inverse<P>("eck2", 320023.223588, 6697754.654662, 4.897000, 52.371000, "+proj=eck2 +ellps=WGS84 +units=m");
+ test_inverse<P>("eck3", 417367.858470, 4923223.990430, 4.897000, 52.371000, "+proj=eck3 +ellps=WGS84 +units=m");
+ test_inverse<P>("eck4", 383678.300021, 6304427.033917, 4.897000, 52.371000, "+proj=eck4 +ellps=WGS84 +units=m");
+ test_inverse<P>("eck5", 387191.346304, 5142132.228246, 4.897000, 52.371000, "+proj=eck5 +ellps=WGS84 +units=m");
+ test_inverse<P>("eck6", 342737.885307, 6363364.830847, 4.897000, 52.371000, "+proj=eck6 +ellps=WGS84 +units=m");
+ test_inverse<P>("eqc", 545131.546415, 5829913.052335, 4.897000, 52.371000, "+proj=eqc +ellps=WGS84 +units=m");
+ test_inverse<P>("eqdc", 307874.536263, 5810915.646438, 4.897000, 52.371000, "+proj=eqdc +ellps=WGS84 +units=m +lat_1=60 +lat_2=0");
+ test_inverse<P>("euler", 338753.024859, 5836825.984893, 4.897000, 52.371000, "+proj=euler +ellps=WGS84 +units=m +lat_1=60 +lat_2=0");
+ test_inverse<P>("fahey", 388824.354103, 5705638.873094, 4.897000, 52.371000, "+proj=fahey +ellps=WGS84 +units=m");
+ test_inverse<P>("fouc", 268017.369817, 6272855.564674, 4.897000, 52.371000, "+proj=fouc +ellps=WGS84 +units=m");
+ test_inverse<P>("fouc_s", 545131.546415, 5051361.531375, 4.897000, 52.371000, "+proj=fouc_s +ellps=WGS84 +units=m");
+ test_inverse<P>("gall", 385466.213109, 5354217.135929, 4.897000, 52.371000, "+proj=gall +ellps=WGS84 +units=m");
+ test_inverse<P>("geocent", 545131.546415, 5829913.052335, 4.897000, 52.371000, "+proj=geocent +ellps=WGS84 +units=m");
+ test_inverse<P>("geos", 313594.638994, 4711397.361812, 4.897000, 52.371000, "+proj=geos +ellps=WGS84 +units=m +h=40000000");
+ test_inverse<P>("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<P>("gnom", 546462.815658, 8303824.612633, 4.897000, 52.371000, "+proj=gnom +ellps=WGS84 +units=m");
+ test_inverse<P>("goode", 360567.451176, 5782693.787691, 4.897000, 52.371000, "+proj=goode +ellps=WGS84 +units=m");
+ test_inverse<P>("gs48", 4904886.323054, 12421187.782392, -84.387019, 33.726470, "+proj=gs48 +ellps=WGS84 +units=m +lon1=-48"); // F/I: 3176.559347
+ test_inverse<P>("gs50", 3190310.148850, -564230.076744, -84.389678, 33.754825, "+proj=gs50 +ellps=WGS84 +units=m +lon1=-50"); // F/I: 35.589174
+ test_inverse<P>("gstmerc", 333173.875017, 5815062.181746, 4.897000, 52.371000, "+proj=gstmerc +ellps=WGS84 +units=m");
+ test_inverse<P>("hatano", 383644.128560, 6290117.704632, 4.897000, 52.371000, "+proj=hatano +ellps=WGS84 +units=m");
+ test_inverse<P>("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<P>("kav5", 383646.088858, 5997047.888175, 4.897000, 52.371000, "+proj=kav5 +ellps=WGS84 +units=m");
+ test_inverse<P>("kav7", 407769.043907, 5829913.052335, 4.897000, 52.371000, "+proj=kav7 +ellps=WGS84 +units=m");
+ test_inverse<P>("krovak", -743286.779768, -1043498.912060, 14.417630, 50.084517, "+proj=krovak +ellps=WGS84 +units=m"); // F/I: 148.642889
+ test_inverse<P>("laea", 371541.476735, 5608007.251007, 4.897000, 52.371000, "+proj=laea +ellps=WGS84 +units=m");
+ test_inverse<P>("latlon", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=latlon +ellps=WGS84 +units=m");
+ test_inverse<P>("latlong", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=latlong +ellps=WGS84 +units=m");
+ test_inverse<P>("lcc", 319700.820572, 5828852.504871, 4.897000, 52.371000, "+proj=lcc +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_inverse<P>("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<P>("leac", 249343.870798, 6909632.226405, 4.897000, 52.371000, "+proj=leac +ellps=WGS84 +units=m");
+ test_inverse<P>("lee_os", 7657412.020774, 4716426.185485, -84.390000, 33.755000, "+proj=lee_os +ellps=WGS84 +units=m");
+ test_inverse<P>("longlat", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=longlat +ellps=WGS84 +units=m");
+ test_inverse<P>("lonlat", 0.085469, 0.914046, 4.897000, 52.371000, "+proj=lonlat +ellps=WGS84 +units=m");
+ test_inverse<P>("loxim", 462770.371742, 5829913.052335, 4.897000, 52.371000, "+proj=loxim +ellps=WGS84 +units=m");
+ test_inverse<P>("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<P>("mbt_fps", 392815.792409, 6007058.470101, 4.897000, 52.371000, "+proj=mbt_fps +ellps=WGS84 +units=m");
+ test_inverse<P>("mbt_s", 389224.301381, 5893467.204064, 4.897000, 52.371000, "+proj=mbt_s +ellps=WGS84 +units=m");
+ test_inverse<P>("mbtfpp", 345191.582111, 6098551.031494, 4.897000, 52.371000, "+proj=mbtfpp +ellps=WGS84 +units=m");
+ test_inverse<P>("mbtfpq", 371214.469979, 5901319.366034, 4.897000, 52.371000, "+proj=mbtfpq +ellps=WGS84 +units=m");
+ test_inverse<P>("mbtfps", 325952.066750, 6266156.827884, 4.897000, 52.371000, "+proj=mbtfps +ellps=WGS84 +units=m");
+ test_inverse<P>("merc", 545131.546415, 6833623.829215, 4.897000, 52.371000, "+proj=merc +ellps=WGS84 +units=m");
+ test_inverse<P>("mil_os", -1017212.552960, 3685935.358004, 4.897000, 52.371000, "+proj=mil_os +ellps=WGS84 +units=m");
+ test_inverse<P>("mill", 545131.546415, 6431916.372717, 4.897000, 52.371000, "+proj=mill +ellps=WGS84 +units=m");
+ test_inverse<P>("moll", 360567.451176, 6119459.421291, 4.897000, 52.371000, "+proj=moll +ellps=WGS84 +units=m");
+ test_inverse<P>("murd1", 333340.993642, 5839071.944597, 4.897000, 52.371000, "+proj=murd1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_inverse<P>("murd2", 317758.821713, 6759296.097305, 4.897000, 52.371000, "+proj=murd2 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_inverse<P>("murd3", 331696.409000, 5839224.186916, 4.897000, 52.371000, "+proj=murd3 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_inverse<P>("nell", 454576.246081, 5355027.851999, 4.897000, 52.371000, "+proj=nell +ellps=WGS84 +units=m");
+ test_inverse<P>("nell_h", 438979.742911, 5386970.539995, 4.897000, 52.371000, "+proj=nell_h +ellps=WGS84 +units=m");
+ test_inverse<P>("nsper", 0.521191, 7.919806, 4.897000, 52.371000, "+proj=nsper +ellps=WGS84 +units=m +a=10 +h=40000000");
+ test_inverse<P>("nzmg", 2669448.884228, 6482177.102194, 174.783333, -36.850000, "+proj=nzmg +ellps=WGS84 +units=m");
+ test_inverse<P>("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<P>("ocea", 90368744555736.703000, -5887882801731.769500, 4.897000, 52.371000, "+proj=ocea +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n +lon_1=1e +lon_2=30e");
+ test_inverse<P>("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<P>("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<P>("ortho", 332422.874291, 5051361.531375, 4.897000, 52.371000, "+proj=ortho +ellps=WGS84 +units=m");
+ test_inverse<P>("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<P>("poly", 333274.269648, 5815908.957562, 4.897000, 52.371000, "+proj=poly +ellps=WGS84 +units=m");
+ test_inverse<P>("putp1", 375730.931178, 5523551.121434, 4.897000, 52.371000, "+proj=putp1 +ellps=WGS84 +units=m");
+ test_inverse<P>("putp2", 351480.997939, 5942668.547355, 4.897000, 52.371000, "+proj=putp2 +ellps=WGS84 +units=m");
+ test_inverse<P>("putp3", 287673.972013, 4651597.610600, 4.897000, 52.371000, "+proj=putp3 +ellps=WGS84 +units=m");
+ test_inverse<P>("putp3p", 361313.008033, 4651597.610600, 4.897000, 52.371000, "+proj=putp3p +ellps=WGS84 +units=m");
+ test_inverse<P>("putp4p", 351947.465829, 6330828.716145, 4.897000, 52.371000, "+proj=putp4p +ellps=WGS84 +units=m"); // F/I: 0.003779
+ test_inverse<P>("putp5", 320544.316171, 5908383.682019, 4.897000, 52.371000, "+proj=putp5 +ellps=WGS84 +units=m");
+ test_inverse<P>("putp5p", 436506.666600, 5908383.682019, 4.897000, 52.371000, "+proj=putp5p +ellps=WGS84 +units=m");
+ test_inverse<P>("putp6", 324931.055842, 5842588.644796, 4.897000, 52.371000, "+proj=putp6 +ellps=WGS84 +units=m");
+ test_inverse<P>("putp6p", 338623.512107, 6396742.919679, 4.897000, 52.371000, "+proj=putp6p +ellps=WGS84 +units=m");
+ test_inverse<P>("qua_aut", 370892.621714, 5629072.862494, 4.897000, 52.371000, "+proj=qua_aut +ellps=WGS84 +units=m");
+ test_inverse<P>("robin", 394576.507489, 5571243.439235, 4.897000, 52.371000, "+proj=robin +ellps=WGS84 +units=m");
+ test_inverse<P>("rouss", 412826.227669, 6248368.849775, 4.959853, 52.433747, "+proj=rouss +ellps=WGS84 +units=m"); // F/I: 8188.459174
+ test_inverse<P>("sinu", 333528.909809, 5804625.044313, 4.897000, 52.371000, "+proj=sinu +ellps=WGS84 +units=m");
+ test_inverse<P>("somerc", 545131.546415, 6833623.829215, 4.897000, 52.371000, "+proj=somerc +ellps=WGS84 +units=m");
+ test_inverse<P>("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<P>("tcea", 332422.874291, 5841186.022551, 4.897000, 52.371000, "+proj=tcea +ellps=WGS84 +units=m");
+ test_inverse<P>("tissot", 431443.972539, 3808494.480735, 4.897000, 52.371000, "+proj=tissot +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_inverse<P>("tmerc", 333425.492136, 5815921.814396, 4.897000, 52.371000, "+proj=tmerc +ellps=WGS84 +units=m");
+ test_inverse<P>("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<P>("tpers", -1172311.936260, 6263306.090352, 4.897000, 52.371000, "+proj=tpers +ellps=WGS84 +units=m +tilt=50 +azi=20 +h=40000000");
+ test_inverse<P>("ups", 2369508.503532, -2312783.579527, 4.897000, 52.371000, "+proj=ups +ellps=WGS84 +units=m");
+ test_inverse<P>("urmfps", 439191.083465, 5919500.887257, 4.897000, 52.371000, "+proj=urmfps +ellps=WGS84 +units=m +n=0.50");
+ test_inverse<P>("utm", 220721.998929, 5810228.672907, 4.897000, 52.371000, "+proj=utm +ellps=WGS84 +units=m +lon_0=11d32'00E");
+ test_inverse<P>("vandg", 489005.929978, 6431581.024949, 4.897000, 52.371000, "+proj=vandg +ellps=WGS84 +units=m");
+ test_inverse<P>("vitk1", 338522.044182, 5839611.656064, 4.897000, 52.371000, "+proj=vitk1 +ellps=WGS84 +units=m +lat_1=20n +lat_2=60n");
+ test_inverse<P>("wag1", 348059.961742, 6344311.295111, 4.897000, 52.371000, "+proj=wag1 +ellps=WGS84 +units=m");
+ test_inverse<P>("wag2", 388567.174132, 6112322.636203, 4.897000, 52.371000, "+proj=wag2 +ellps=WGS84 +units=m");
+ test_inverse<P>("wag3", 447014.436776, 5829913.052335, 4.897000, 52.371000, "+proj=wag3 +ellps=WGS84 +units=m");
+ test_inverse<P>("wag4", 365021.547713, 6300040.998324, 4.897000, 52.371000, "+proj=wag4 +ellps=WGS84 +units=m");
+ test_inverse<P>("wag5", 379647.914735, 6771982.379506, 4.897000, 52.371000, "+proj=wag5 +ellps=WGS84 +units=m");
+ test_inverse<P>("wag6", 446107.907415, 5523551.121434, 4.897000, 52.371000, "+proj=wag6 +ellps=WGS84 +units=m");
+ test_inverse<P>("weren", 402668.037596, 7243190.025762, 4.897000, 52.371000, "+proj=weren +ellps=WGS84 +units=m"); // F/I: 0.003779
+ test_inverse<P>("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<P>("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<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+ test_all<test::test_point>();
+ //test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+ test_all<boost::geometry::point_xy<long double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="projections"
+ ProjectGUID="{38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}"
+ RootNamespace="projections"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projections"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ Optimization="0"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projections"
+ ConfigurationType="1"
+ InheritedPropertySheets="../../../boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/bigobj"
+ AdditionalIncludeDirectories="../..//../../..;../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\projections.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/gis/projections/projections_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,31 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projection", "projection.vcproj", "{A46D98E8-88F2-4795-B839-CD3F6082E7B2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projections", "projections.vcproj", "{38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projection_epsg", "projection_epsg.vcproj", "{06E9D20E-FF21-4245-89B4-04387F0F0DCC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Debug|Win32.Build.0 = Debug|Win32
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Release|Win32.ActiveCfg = Release|Win32
+ {A46D98E8-88F2-4795-B839-CD3F6082E7B2}.Release|Win32.Build.0 = Release|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Debug|Win32.Build.0 = Debug|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Release|Win32.ActiveCfg = Release|Win32
+ {38CDDD8A-3B15-4D38-85CA-7EC446FA61FA}.Release|Win32.Build.0 = Release|Win32
+ {06E9D20E-FF21-4245-89B4-04387F0F0DCC}.Debug|Win32.ActiveCfg = Debug|Win32
+ {06E9D20E-FF21-4245-89B4-04387F0F0DCC}.Debug|Win32.Build.0 = Debug|Win32
+ {06E9D20E-FF21-4245-89B4-04387F0F0DCC}.Release|Win32.ActiveCfg = Release|Win32
+ {06E9D20E-FF21-4245-89B4-04387F0F0DCC}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/extensions/index/index.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/index/index.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rtree", "rtree.vcproj", "{5542B923-D429-4393-968F-E62DDCE4B87C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5542B923-D429-4393-968F-E62DDCE4B87C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5542B923-D429-4393-968F-E62DDCE4B87C}.Debug|Win32.Build.0 = Debug|Win32
+ {5542B923-D429-4393-968F-E62DDCE4B87C}.Release|Win32.ActiveCfg = Release|Win32
+ {5542B923-D429-4393-968F-E62DDCE4B87C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/extensions/index/rtree.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/index/rtree.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,26 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Mateusz Loskot <mateusz_at_[hidden]>, 2009
+// Use, modification and distribution is subject to the 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 <cstddef>
+
+#include <boost/test/floating_point_comparison.hpp>
+#include <boost/test/included/test_exec_monitor.hpp>
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+
+#include <boost/geometry/extensions/index/rtree/rtree.hpp>
+
+int test_main(int, char* [])
+{
+
+ // TODO: mloskot - This is ONLY compilation test and
+ // placeholder to implement real test.
+
+ boost::geometry::index::rtree<boost::geometry::box_2d, std::size_t> si(1, 6);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/index/rtree.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/index/rtree.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="rtree"
+ ProjectGUID="{5542B923-D429-4393-968F-E62DDCE4B87C}"
+ RootNamespace="rtree"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\rtree"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ RuntimeLibrary="3"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\rtree"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\rtree.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/access.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/access.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,60 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/extensions/nsphere/core/access.hpp>
+#include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
+
+
+
+template <typename G>
+void test_get_set()
+{
+ typedef typename boost::geometry::coordinate_type<G>::type coordinate_type;
+
+ G g;
+ boost::geometry::set<0>(g, coordinate_type(1));
+ boost::geometry::set<1>(g, coordinate_type(2));
+
+ coordinate_type x = boost::geometry::get<0>(g);
+ coordinate_type y = boost::geometry::get<1>(g);
+
+ BOOST_CHECK_CLOSE(double(x), 1.0, 0.0001);
+ BOOST_CHECK_CLOSE(double(y), 2.0, 0.0001);
+}
+
+
+template <typename P>
+void test_all()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+
+ // N-SPHERE, setting sphere center
+ test_get_set<boost::geometry::nsphere<P, coordinate_type> >();
+
+}
+
+
+int test_main(int, char* [])
+{
+ test_get_set<int[2]>();
+ test_get_set<float[2]>();
+ test_get_set<double[2]>();
+ test_get_set<double[3]>();
+
+ test_get_set<boost::tuple<double, double> >();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/area.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/area.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,33 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/nsphere/algorithms/area.hpp>
+#include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
+
+
+template <typename P, typename T>
+void test_area_circle()
+{
+ boost::geometry::nsphere<P, T> c;
+
+ boost::geometry::set<0>(c.center(), 0);
+ boost::geometry::set<1>(c.center(), 0);
+ c.radius(2);
+
+ double d = boost::geometry::area(c);
+ BOOST_CHECK_CLOSE(d, 4 * 3.1415926535897932384626433832795, 0.001);
+}
+
+
+
+int test_main(int, char* [])
+{
+ test_area_circle<boost::geometry::point<double, 2, boost::geometry::cs::cartesian>, double>();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/area.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/area.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="area"
+ ProjectGUID="{8223B570-E7E1-4621-BE02-C2F9B5CF278D}"
+ RootNamespace="area"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\area"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\area.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/circle.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/circle.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,195 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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)
+// We deliberately mix float/double's here so turn off warnings
+#pragma warning( disable : 4244 )
+#pragma warning( disable : 4305 )
+#endif // defined(_MSC_VER)
+
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/nsphere/core/access.hpp>
+#include <boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp>
+#include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
+
+#include <boost/geometry/core/cs.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+
+using namespace boost::geometry;
+
+// define a custom circle
+struct custom_circle
+{
+ float x,y;
+ int r;
+};
+
+// adapt custom circle using traits
+namespace boost { namespace geometry { namespace traits {
+
+template<>
+struct tag<custom_circle>
+{
+ typedef nsphere_tag type;
+};
+
+template<>
+struct point_type<custom_circle>
+{
+ typedef point<double, 2, cs::cartesian> type;
+};
+
+template<>
+struct radius_type<custom_circle>
+{
+ typedef int type;
+};
+
+template<>
+struct access<custom_circle, 0>
+{
+ static inline const float& get(custom_circle const& c)
+ {
+ return c.x;
+ }
+
+ static inline void set(custom_circle& c, float const& value)
+ {
+ c.y = value;
+ }
+};
+
+template<>
+struct access<custom_circle, 1>
+{
+ static inline const float& get(const custom_circle& c)
+ {
+ return c.y;
+ }
+
+ static inline void set(custom_circle& c, float const& value)
+ {
+ c.y = value;
+ }
+};
+
+template<>
+struct radius_access<custom_circle, int, 0>
+{
+ static inline int get(custom_circle const& c)
+ {
+ return c.r;
+ }
+
+ static inline void set(custom_circle& c, int const& radius)
+ {
+ c.r = radius;
+ }
+};
+
+}}} // namespace boost::geometry::traits
+
+
+template <typename S, typename RT, typename CT>
+void check_nsphere(S& to_check, RT radius, CT center_x, CT center_y, CT center_z)
+{
+ BOOST_CONCEPT_ASSERT( (concept::ConstNsphere<S>) );
+ BOOST_CONCEPT_ASSERT( (concept::Nsphere<S>) );
+
+
+ BOOST_CHECK_EQUAL(get_radius<0>(to_check), radius);
+
+ BOOST_CHECK_EQUAL(get<0>(to_check), center_x);
+ BOOST_CHECK_EQUAL(get<1>(to_check), center_y);
+ if (dimension<S>::value >= 3)
+ {
+ BOOST_CHECK_EQUAL(get<2>(to_check), center_z);
+ }
+}
+
+template <typename P, typename T>
+void test_construction()
+{
+ typedef typename coordinate_type<P>::type ctype;
+
+ nsphere<P, T> c1;
+ check_nsphere(c1, 0, 0,0,0);
+
+ P center;
+ boost::geometry::assign(center, 1, 2, 3);
+ nsphere<P, T> c2(center, 4);
+ check_nsphere(c2, 4, 1,2,3);
+}
+
+template <typename C>
+void test_assignment_3d()
+{
+ C c;
+
+ // by hand
+ set<0>(c, 5);
+ set<1>(c, 50);
+ set<2>(c, 500);
+
+ set_radius<0>(c, 5000);
+ check_nsphere(c, 5000, 5,50,500);
+
+ assign(c, 6, 60, 600);
+ check_nsphere(c, 5000, 6,60,600);
+}
+
+template <typename C>
+void test_assignment_2d()
+{
+ C c;
+
+ // by hand
+ set<0>(c, 5);
+ set<1>(c, 50);
+
+ set_radius<0>(c, 5000);
+}
+
+
+template <typename P, typename T>
+void test_all()
+{
+ test_construction<P, T>();
+ test_assignment_3d<nsphere<P, T> >();
+}
+
+template <typename P>
+void test_all()
+{
+ test_all<P, int>();
+ test_all<P, float>();
+ test_all<P, double>();
+}
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test::test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ test_assignment_2d<custom_circle>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/circle.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/circle.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="circle"
+ ProjectGUID="{E19B65F6-FAF0-47FD-84A2-3BAE1B703967}"
+ RootNamespace="circle"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\circle"
+ InheritedPropertySheets="../../boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\circle"
+ InheritedPropertySheets="../../boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\circle.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/multi_within.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/multi_within.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,49 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/algorithms/correct.hpp>
+#include <boost/geometry/algorithms/within.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/linestring.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+#include <boost/geometry/multi/algorithms/within.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+int test_main( int , char* [] )
+{
+ typedef boost::geometry::point_xy<double> gl_point;
+ typedef boost::geometry::circle gl_circle;
+ typedef boost::geometry::linear_ring<gl_point> gl_ring;
+ typedef boost::geometry::polygon<gl_point> gl_polygon;
+ typedef boost::geometry::multi_polygon<gl_polygon> gl_multi_polygon;
+
+ gl_circle circle(gl_point(1, 1), 2.5);
+
+ gl_ring ring;
+ ring.push_back(gl_point(0,0));
+ ring.push_back(gl_point(1,0));
+ ring.push_back(gl_point(1,1));
+ ring.push_back(gl_point(0,1));
+ boost::geometry::correct(ring);
+
+ gl_polygon pol;
+ pol.outer() = ring;
+ gl_multi_polygon multi_polygon;
+ multi_polygon.push_back(pol);
+
+ // Multipolygon in circle
+ BOOST_CHECK_EQUAL(within(multi_polygon, circle), true);
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/npshere_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/npshere_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,32 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "circle", "circle.vcproj", "{E19B65F6-FAF0-47FD-84A2-3BAE1B703967}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "area", "area.vcproj", "{8223B570-E7E1-4621-BE02-C2F9B5CF278D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "within", "within.vcproj", "{3659D050-0E76-4679-BB87-369CC8FA31E9}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Debug|Win32.Build.0 = Debug|Win32
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Release|Win32.ActiveCfg = Release|Win32
+ {E19B65F6-FAF0-47FD-84A2-3BAE1B703967}.Release|Win32.Build.0 = Release|Win32
+ {8223B570-E7E1-4621-BE02-C2F9B5CF278D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {8223B570-E7E1-4621-BE02-C2F9B5CF278D}.Debug|Win32.Build.0 = Debug|Win32
+ {8223B570-E7E1-4621-BE02-C2F9B5CF278D}.Release|Win32.ActiveCfg = Release|Win32
+ {8223B570-E7E1-4621-BE02-C2F9B5CF278D}.Release|Win32.Build.0 = Release|Win32
+ {3659D050-0E76-4679-BB87-369CC8FA31E9}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3659D050-0E76-4679-BB87-369CC8FA31E9}.Debug|Win32.Build.0 = Debug|Win32
+ {3659D050-0E76-4679-BB87-369CC8FA31E9}.Release|Win32.ActiveCfg = Release|Win32
+ {3659D050-0E76-4679-BB87-369CC8FA31E9}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/point_type.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/point_type.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,72 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/core/tag.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+
+#include <vector>
+#include <deque>
+
+
+template <typename G, typename Expected>
+void test_geometry()
+{
+ BOOST_CHECK_EQUAL(typeid(typename boost::geometry::point_type<G>::type).name(),
+ typeid(Expected).name());
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<P, P>();
+ test_geometry<const P, P>();
+ test_geometry<boost::geometry::linestring<P> , P>();
+ test_geometry<boost::geometry::linear_ring<P> , P>();
+ test_geometry<boost::geometry::polygon<P> , P>();
+ test_geometry<boost::geometry::box<P> , P>();
+ test_geometry<boost::geometry::segment<P> , P>();
+ test_geometry<boost::geometry::segment<const P> , P>();
+ test_geometry<boost::geometry::nsphere<P, double> , P>();
+
+ test_geometry<std::vector<P>, P>();
+ test_geometry<std::deque<P>, P>();
+
+ test_geometry<boost::array<P, 5>, P>();
+}
+
+int test_main(int, char* [])
+{
+ test_geometry<int[2], int[2]>();
+ test_geometry<float[2], float[2]>();
+ test_geometry<double[2], double[2]>();
+
+ test_geometry<int[3], int[3]>();
+ test_geometry<float[3], float[3]>();
+ test_geometry<double[3], double[3]>();
+
+ test_geometry<boost::tuple<double, double>,
+ boost::tuple<double, double> >();
+ test_geometry<boost::tuple<double, double, double>,
+ boost::tuple<double, double, double> >();
+
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/within.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/within.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,55 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/nsphere/nsphere.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+template <typename Geometry>
+void test_circle(std::string const& wkt_geometry, bool expected)
+{
+ boost::geometry::circle circle;
+ boost::geometry::assign(circle, 1.0, 1.0, 3.0);
+
+ Geometry geometry;
+ boost::geometry::read_wkt(wkt_geometry, geometry);
+
+ bool detected = boost::geometry::within(geometry, circle);
+
+ BOOST_CHECK_MESSAGE(detected == expected,
+ "within: " << wkt_geometry
+ << " in circle (1,1) with radius 3"
+ << " -> Expected: " << expected
+ << " detected: " << detected);
+}
+
+
+
+
+template <typename P>
+void test_circles()
+{
+ // Circles do not yet run on CLN/GMP
+ test_circle<P>("POINT(2 1)", true);
+ test_circle<P>("POINT(12 1)", false);
+
+ test_circle<boost::geometry::linestring<P> >("LINESTRING(1 1,2 1,2 2)", true);
+ test_circle<boost::geometry::linestring<P> >("LINESTRING(1 1,2 1,2 2,10 10)", false);
+}
+
+
+int test_main( int , char* [] )
+{
+ test_circles<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/extensions/nsphere/within.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/extensions/nsphere/within.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="within"
+ ProjectGUID="{3659D050-0E76-4679-BB87-369CC8FA31E9}"
+ RootNamespace="within"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\within"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\within"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="..//../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\within.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/geometries/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,26 @@
+# test/geometries/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-geometries
+ :
+ [ run box.cpp ]
+ [ compile-fail custom_linestring.cpp
+ : # requirements
+ <define>TEST_FAIL_CLEAR
+ : # target name
+ custom_linestring_test_fail_clear
+ ]
+ [ compile-fail custom_linestring.cpp
+ : # requirements
+ <define>TEST_FAIL_APPEND
+ : # target name
+ custom_linestring_test_fail_append
+ ]
+ [ run custom_linestring.cpp ]
+ [ run segment.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/geometries/adapted.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/adapted.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,105 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <deque>
+#include <vector>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/multi/multi.hpp>
+
+#define BOOST_GEOMETRY_TEST_RING
+
+
+
+#if defined(BOOST_GEOMETRY_TEST_RING)
+
+ #include <boost/geometry/geometries/concepts/ring_concept.hpp>
+
+ #include <boost/geometry/geometries/adapted/boost_array_as_ring.hpp>
+ #include <boost/geometry/geometries/adapted/c_array_as_ring.hpp>
+ #include <boost/geometry/geometries/adapted/std_as_ring.hpp>
+
+#elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT)
+
+ #include <boost/geometry/multi/geometries/concepts/multi_point_concept.hpp>
+
+ #include <boost/geometry/multi/geometries/adapted/boost_array_as_multi_point.hpp>
+ #include <boost/geometry/multi/geometries/adapted/c_array_as_multi_point.hpp>
+ #include <boost/geometry/multi/geometries/adapted/std_as_multi_point.hpp>
+
+
+#else
+ #include <boost/geometry/geometries/concepts/linestring_concept.hpp>
+
+ #include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+ #include <boost/geometry/geometries/adapted/c_array_as_linestring.hpp>
+ #include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+#endif
+
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <test_common/test_point.hpp>
+
+
+// ----------------------------------------------------------------------------
+
+template <typename G>
+void test_geometry(G const& geometry, int expected_size = 0)
+{
+#if defined(BOOST_GEOMETRY_TEST_RING)
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstRing<G>) );
+#elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT)
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstMultiPoint<G>) );
+#else
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstLinestring<G>) );
+#endif
+
+ typedef typename boost::geometry::point_type<G>::type P;
+ typedef typename boost::geometry::coordinate_type<P>::type C;
+
+ // Check range-like behaviour
+ BOOST_CHECK_EQUAL(boost::size(geometry), expected_size);
+
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry(std::vector<P>());
+ test_geometry(std::deque<P>());
+ //test_geometry(std::list<P>());
+
+
+ test_geometry(boost::array<P, 5>(), 5);
+
+
+ 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::test_point>();
+ test_all<boost::tuple<float, float> >();
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<long double, 2, boost::geometry::cs::cartesian> >();
+*/
+ test_all<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> >();
+ //test_all<boost::geometry::point<long double, 3, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/geometries/box.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/box.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,97 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/make.hpp>
+
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+using namespace boost::geometry;
+
+template <typename P>
+box<P> create_box()
+{
+ P p1;
+ P p2;
+ assign(p1, 1, 2, 5);
+ assign(p2, 3, 4, 6);
+ return box<P>(p1, p2);
+}
+
+template <typename B, typename T>
+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(get<0>(to_check.min_corner()), min_x);
+ BOOST_CHECK_EQUAL(get<1>(to_check.min_corner()), min_y);
+ BOOST_CHECK_EQUAL(get<2>(to_check.min_corner()), min_z);
+ BOOST_CHECK_EQUAL(get<0>(to_check.max_corner()), max_x);
+ BOOST_CHECK_EQUAL(get<1>(to_check.max_corner()), max_y);
+ BOOST_CHECK_EQUAL(get<2>(to_check.max_corner()), max_z);
+}
+
+template <typename P>
+void test_construction()
+{
+ typedef typename coordinate_type<P>::type T;
+
+ box<P> b1 = make_zero<box<P> >();
+ check_box(b1, T(),T(),T(),T(),T(),T());
+
+ box<P> b2(create_box<P>());
+ check_box(b2, 1,2,5,3,4,6);
+
+ box<P> b3 = make_inverse<box<P> >();
+ check_box(b3, boost::numeric::bounds<T>::highest(),
+ boost::numeric::bounds<T>::highest(),
+ boost::numeric::bounds<T>::highest(),
+ boost::numeric::bounds<T>::lowest(),
+ boost::numeric::bounds<T>::lowest(),
+ boost::numeric::bounds<T>::lowest());
+}
+
+template <typename P>
+void test_assignment()
+{
+ box<P> b(create_box<P>());
+ set<0>(b.min_corner(), 10);
+ set<1>(b.min_corner(), 20);
+ set<2>(b.min_corner(), 30);
+ set<0>(b.max_corner(), 40);
+ set<1>(b.max_corner(), 50);
+ set<2>(b.max_corner(), 60);
+ check_box(b, 10,20,30,40,50,60);
+}
+
+template <typename P>
+void test_all()
+{
+ test_construction<P>();
+ test_assignment<P>();
+}
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test::test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/geometries/box.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/box.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="box"
+ ProjectGUID="{EB7B69C6-2D62-43BC-BA18-D15BEB998665}"
+ RootNamespace="box"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\box"
+ InheritedPropertySheets="..\boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\box"
+ InheritedPropertySheets="..\boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\box.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/geometries/concepts/check.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/concepts/check.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,70 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/core/cs.hpp>
+#include <boost/geometry/geometries/concepts/check.hpp>
+
+struct ro_point
+{
+ float x, y;
+};
+
+
+struct rw_point
+{
+ float x, y;
+};
+
+
+namespace boost { namespace geometry { namespace traits {
+
+template <> struct tag<ro_point> { typedef point_tag type; };
+template <> struct coordinate_type<ro_point> { typedef float type; };
+template <> struct coordinate_system<ro_point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<ro_point> { enum { value = 2 }; };
+
+template <> struct access<ro_point, 0>
+{
+ static float get(ro_point const& p) { return p.x; }
+};
+
+template <> struct access<ro_point, 1>
+{
+ static float get(ro_point const& p) { return p.y; }
+};
+
+
+
+
+template <> struct tag<rw_point> { typedef point_tag type; };
+template <> struct coordinate_type<rw_point> { typedef float type; };
+template <> struct coordinate_system<rw_point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<rw_point> { enum { value = 2 }; };
+
+template <> struct access<rw_point, 0>
+{
+ static float get(rw_point const& p) { return p.x; }
+ static void set(rw_point& p, float value) { p.x = value; }
+};
+
+template <> struct access<rw_point, 1>
+{
+ static float get(rw_point const& p) { return p.y; }
+ static void set(rw_point& p, float value) { p.y = value; }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+
+int main()
+{
+ boost::geometry::concept::check<const ro_point>();
+ boost::geometry::concept::check<rw_point>();
+}

Added: sandbox/geometry/libs/geometry/test/geometries/concepts/check.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/concepts/check.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "check", "check.vcproj", "{6260214E-DB6F-4934-ADF7-DD2B1666171B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.Build.0 = Debug|Win32
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.ActiveCfg = Release|Win32
+ {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/geometries/concepts/check.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/concepts/check.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="check"
+ ProjectGUID="{6260214E-DB6F-4934-ADF7-DD2B1666171B}"
+ RootNamespace="check"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\check"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../../boost;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\check"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../../boost;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\check.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/geometries/custom_linestring.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/custom_linestring.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,132 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <deque>
+#include <vector>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/append.hpp>
+#include <boost/geometry/algorithms/clear.hpp>
+#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/core/access.hpp>
+#include <boost/geometry/geometries/concepts/linestring_concept.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/std_as_linestring.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+//#define TEST_FAIL_CLEAR
+//#define TEST_FAIL_APPEND
+
+
+
+// ----------------------------------------------------------------------------
+// First custom linestring, requires ONLY one traits: to register itself as a linestring
+template <typename P>
+struct custom_linestring1 : std::vector<P> {};
+
+namespace boost { namespace geometry { namespace traits {
+ template <typename P>
+ struct tag< custom_linestring1<P> > { typedef linestring_tag type; };
+}}} // namespace boost::geometry::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 <typename P>
+struct custom_linestring2 : std::deque<P> {};
+
+namespace boost { namespace geometry { namespace traits {
+ template <typename P>
+ struct tag< custom_linestring2<P> > { typedef linestring_tag type; };
+
+ template <typename P>
+ struct use_std< custom_linestring2<P> >
+ {
+ static const bool value = false;
+ };
+
+#if ! defined(TEST_FAIL_CLEAR)
+ template <typename P>
+ struct clear< custom_linestring2<P> >
+ {
+ static inline void apply(custom_linestring2<P>& ls) { ls.resize(0); }
+ };
+#endif
+
+#if ! defined(TEST_FAIL_APPEND)
+ template <typename P>
+ struct append_point< custom_linestring2<P>, P>
+ {
+ static inline void apply(custom_linestring2<P>& geometry,
+ const P& point, int ring_index, int multi_index)
+ {
+ // does not use push-back but something else.
+ geometry.insert(geometry.end(), point);
+ }
+ };
+#endif
+}}} // namespace boost::geometry::traits
+
+// ----------------------------------------------------------------------------
+
+template <typename G>
+void test_linestring()
+{
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::Linestring<G>) );
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::ConstLinestring<G>) );
+
+ G geometry;
+ typedef typename boost::geometry::point_type<G>::type P;
+
+ boost::geometry::clear(geometry);
+ BOOST_CHECK_EQUAL(boost::size(geometry), 0);
+
+ boost::geometry::append(geometry, boost::geometry::make_zero<P>());
+ BOOST_CHECK_EQUAL(boost::size(geometry), 1);
+
+ //std::cout << geometry << std::endl;
+
+ boost::geometry::clear(geometry);
+ BOOST_CHECK_EQUAL(boost::size(geometry), 0);
+
+
+ //P p = boost::range::front(geometry);
+}
+
+template <typename P>
+void test_all()
+{
+ test_linestring<boost::geometry::linestring<P> >();
+ test_linestring<boost::geometry::linestring<P, std::vector> >();
+ test_linestring<boost::geometry::linestring<P, std::deque> >();
+
+ test_linestring<custom_linestring1<P> >();
+ test_linestring<custom_linestring2<P> >();
+
+ test_linestring<std::vector<P> >();
+ test_linestring<std::deque<P> >();
+ //test_linestring<std::list<P> >();
+}
+
+int test_main(int, char* [])
+{
+ test_all<test::test_point>();
+ test_all<boost::tuple<float, float> >();
+ test_all<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/geometries/custom_linestring.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/custom_linestring.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="custom_linestring"
+ ProjectGUID="{CA8D5E44-7D8F-44A1-900C-35C28890299B}"
+ RootNamespace="custom_linestring"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\custom_linestring"
+ InheritedPropertySheets="..\boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\custom_linestring"
+ InheritedPropertySheets="..\boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\custom_linestring.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/geometries/geometries_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/geometries_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,31 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "box", "box.vcproj", "{EB7B69C6-2D62-43BC-BA18-D15BEB998665}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_linestring", "custom_linestring.vcproj", "{CA8D5E44-7D8F-44A1-900C-35C28890299B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment", "segment.vcproj", "{F995B070-62A2-46FE-A676-79AADB71DBD8}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Debug|Win32.Build.0 = Debug|Win32
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Release|Win32.ActiveCfg = Release|Win32
+ {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Release|Win32.Build.0 = Release|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32
+ {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.Build.0 = Release|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Debug|Win32.Build.0 = Debug|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Release|Win32.ActiveCfg = Release|Win32
+ {F995B070-62A2-46FE-A676-79AADB71DBD8}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/geometries/segment.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/segment.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,114 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <iostream>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/geometries/concepts/segment_concept.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/segment.hpp>
+
+#include <boost/geometry/geometries/register/point.hpp>
+#include <boost/geometry/geometries/register/segment.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/geometry/util/write_dsv.hpp>
+
+
+#include <test_common/test_point.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::segment<P> 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( (boost::geometry::concept::ConstSegment<S>) );
+ BOOST_CONCEPT_ASSERT( (boost::geometry::concept::Segment<S>) );
+
+ typedef typename boost::geometry::coordinate_type<S>::type T;
+ typedef typename boost::geometry::point_type<S>::type SP;
+
+
+ //std::cout << sizeof(typename coordinate_type<S>::type) << std::endl;
+
+ typedef boost::geometry::segment<const P> CS;
+ //BOOST_CONCEPT_ASSERT( (concept::ConstSegment<CS>) );
+
+ CS cs(p1, p2);
+
+ typedef typename boost::geometry::coordinate_type<CS>::type CT;
+ typedef typename boost::geometry::point_type<CS>::type CSP;
+}
+
+struct custom_point
+{
+ double x, y;
+};
+struct custom_segment
+{
+ custom_point one, two;
+};
+template <typename P>
+struct custom_segment_of
+{
+ P p1, p2;
+};
+struct custom_segment_4
+{
+ double a, b, c, d;
+};
+
+BOOST_GEOMETRY_REGISTER_POINT_2D(custom_point, double, boost::geometry::cs::cartesian, x, y)
+BOOST_GEOMETRY_REGISTER_SEGMENT(custom_segment, custom_point, one, two)
+BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(custom_segment_of, p1, p2)
+BOOST_GEOMETRY_REGISTER_SEGMENT_2D_4VALUES(custom_segment_4, custom_point, a, b, c, d)
+
+
+template <typename S>
+void test_custom()
+{
+ S seg;
+ boost::geometry::set<0,0>(seg, 1);
+ boost::geometry::set<0,1>(seg, 2);
+ boost::geometry::set<1,0>(seg, 3);
+ boost::geometry::set<1,1>(seg, 4);
+ std::ostringstream out;
+ out << boost::geometry::dsv(seg);
+ BOOST_CHECK_EQUAL(out.str(), "((1, 2), (3, 4))");
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ //test_all<test_point>();
+ test_all<boost::geometry::point<int, 3, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 3, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> >();
+
+ test_custom<custom_segment>();
+ test_custom<custom_segment_of<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> > >();
+ test_custom<custom_segment_of<custom_point> >();
+ test_custom<custom_segment_4>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/geometries/segment.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/geometries/segment.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="segment"
+ ProjectGUID="{F995B070-62A2-46FE-A676-79AADB71DBD8}"
+ RootNamespace="segment"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment"
+ InheritedPropertySheets="..\boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment"
+ InheritedPropertySheets="..\boost.vsprops"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\segment.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/ggl_headers.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/ggl_headers.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ggl_headers", "ggl_headers.vcproj", "{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.Build.0 = Debug|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.ActiveCfg = Release|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/ggl_headers.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/ggl_headers.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,1339 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ggl_headers"
+ ProjectGUID="{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}"
+ RootNamespace="ggl_headers"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="10"
+ InheritedPropertySheets=".\boost.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="10"
+ InheritedPropertySheets=".\boost.vsprops"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="ggl"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\ggl.hpp"
+ >
+ </File>
+ <Filter
+ Name="iterators"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\iterators\base.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\iterators\circular_iterator.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\iterators\ever_circling_iterator.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\iterators\section_iterators.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\iterators\segment_iterator.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="algorithms"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\append.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\area.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\assign.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\buffer.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\centroid.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\clear.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\combine.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\convert.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\convex_hull.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\correct.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\envelope.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\for_each.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\intermediate.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\intersection.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\intersection_linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\intersection_polygon.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\intersection_segment.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\labelinfo.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\length.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\make.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\num_points.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\overlaps.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\parse.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\perimeter.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\point_on_line.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\sectionalize.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\selected.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\simplify.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\transform.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\within.hpp"
+ >
+ </File>
+ <Filter
+ Name="detail"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\algorithms\detail\calculate_null.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="arithmetic"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\arithmetic\arithmetic.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\arithmetic\dot_product.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="core"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\core\access.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\coordinate_dimension.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\coordinate_system.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\coordinate_type.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\cs.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\exterior_ring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\geometry_id.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\interior_rings.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\is_linear.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\is_multi.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\point_type.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\radian_access.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\radius.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\replace_point_type.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\reverse_dispatch.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\ring_type.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\tag.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\tags.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\topological_dimension.hpp"
+ >
+ </File>
+ <Filter
+ Name="concepts"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\core\concepts\box_concept.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\concepts\linestring_concept.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\concepts\nsphere_concept.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\concepts\point_concept.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\concepts\polygon_concept.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\concepts\ring_concept.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\core\concepts\segment_concept.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="geometries"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\box.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\cartesian2d.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\cartesian3d.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\geometries.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\latlong.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\linear_ring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\nsphere.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\point.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\point_ll.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\point_xy.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\polygon.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\segment.hpp"
+ >
+ </File>
+ <Filter
+ Name="adapted"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\boost_array_as_linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\boost_array_as_ring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\c_array.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\c_array_cartesian.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\c_array_geographic.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\std_as_linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\std_as_ring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\tuple.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\tuple_cartesian.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\adapted\tuple_geographic.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="register"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\register\register_box.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\geometries\register\register_point.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="multi"
+ >
+ <Filter
+ Name="algorithms"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\area.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\convex_hull.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\correct.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\envelope.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\foreach.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\intersection.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\length.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\num_points.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\perimeter.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\simplify.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\within.hpp"
+ >
+ </File>
+ <Filter
+ Name="detail"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\algorithms\detail\multi_sum.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="geometries"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\geometries\multi_linestring.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\geometries\multi_point.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\geometries\multi_polygon.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="io"
+ >
+ <Filter
+ Name="wkt"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\io\wkt\read_wkt.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\io\wkt\write_wkt.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="core"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\core\geometry_id.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\core\is_multi.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\core\point_type.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\core\tags.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\multi\core\topological_dimension.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="io"
+ >
+ <Filter
+ Name="wkt"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\io\wkt\read_wkt.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\io\wkt\stream_wkt.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\io\wkt\write_wkt.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="veshape"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\io\veshape\write_veshape.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="wkb"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\io\wkb\read_wkb.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\io\wkb\utility.hpp"
+ >
+ </File>
+ <Filter
+ Name="detail"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\io\wkb\detail\ogc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\io\wkb\detail\parser.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="projections"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\epsg.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\epsg_traits.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\factory.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\parameters.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\project_inverse_transformer.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\project_transformer.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\projection.hpp"
+ >
+ </File>
+ <Filter
+ Name="impl"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\aasincos.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\adjlon.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\base_dynamic.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\base_static.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\factory_entry.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\function_overloads.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_auth.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_datum_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_datums.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_ell_set.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_ellps.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_fwd.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_gauss.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_init.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_inv.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_mlfn.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_msfn.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_param.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_phi2.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_qsfn.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_tsfn.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_units.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\pj_zpoly1.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\proj_mdist.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\impl\projects.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="proj"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\aea.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\aeqd.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\airy.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\aitoff.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\august.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\bacon.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\bipc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\boggs.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\bonne.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\cass.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\cc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\cea.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\chamb.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\collg.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\crast.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\denoy.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\eck1.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\eck2.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\eck3.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\eck4.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\eck5.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\eqc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\eqdc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\fahey.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\fouc_s.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\gall.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\geocent.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\geos.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\gins8.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\gn_sinu.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\gnom.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\goode.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\gstmerc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\hammer.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\hatano.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\imw_p.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\krovak.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\labrd.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\laea.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\lagrng.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\larr.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\lask.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\latlong.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\lcc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\lcca.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\loxim.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\lsat.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\mbt_fps.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\mbtfpp.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\mbtfpq.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\merc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\mill.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\mod_ster.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\moll.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\nell.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\nell_h.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\nocol.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\nsper.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\nzmg.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\ob_tran.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\ocea.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\oea.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\omerc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\ortho.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\poly.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\putp2.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\putp3.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\putp4p.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\putp5.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\putp6.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\robin.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\rouss.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\rpoly.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\sconics.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\somerc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\stere.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\sterea.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\sts.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\tcc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\tcea.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\tmerc.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\tpeqd.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\urm5.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\urmfps.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\vandg.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\vandg2.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\vandg4.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\wag2.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\wag3.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\wag7.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\wink1.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\projections\proj\wink2.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="index"
+ >
+ <Filter
+ Name="rtree"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\index\rtree\helpers.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\index\rtree\rtree.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\index\rtree\rtree_leaf.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\index\rtree\rtree_node.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="strategies"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\distance_result.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\intersection_policies.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\intersection_result.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\strategies.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\strategy_traits.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\strategy_transform.hpp"
+ >
+ </File>
+ <Filter
+ Name="agnostic"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\agnostic\agn_convex_hull.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\agnostic\agn_simplify.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\agnostic\agn_within.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="cartesian"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_area.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_centroid.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_compare.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_envelope.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_intersect.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_side.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\cartesian\cart_within.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="geographic"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\geographic\geo_distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\geographic\geo_parse.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="spherical"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\spherical\sph_area.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\spherical\sph_distance.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\spherical\sph_envelope.hpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="transform"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\transform\inverse_transformer.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\transform\map_transformer.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\strategies\transform\matrix_transformers.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="util"
+ >
+ <File
+ RelativePath="..\..\..\boost\ggl\util\as_range.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\assign_box_corner.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\builder.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\copy.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\for_each_coordinate.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\graticule.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\loop.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\math.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\boost\ggl\util\promotion_traits.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/ggl_test_common.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/ggl_test_common.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,71 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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
+
+#if defined(_MSC_VER)
+// 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(_MSC_VER)
+
+#include <boost/foreach.hpp>
+
+
+// Include some always-included-for-testing files
+#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
+# include <boost/test/floating_point_comparison.hpp>
+# include <boost/test/included/test_exec_monitor.hpp>
+#endif
+
+
+#if defined(HAVE_CLN) || defined(HAVE_GMP)
+# include <boost/numeric_adaptor/numeric_adaptor.hpp>
+#endif
+
+
+#if defined(HAVE_GMP)
+# include <boost/numeric_adaptor/gmp_value_type.hpp>
+#endif
+#if defined(HAVE_CLN)
+# include <boost/numeric_adaptor/cln_value_type.hpp>
+#endif
+
+template <typename T>
+struct string_from_type {};
+
+template <> struct string_from_type<void>
+{ static std::string name() { return "v"; } };
+
+template <> struct string_from_type<float>
+{ static std::string name() { return "f"; } };
+
+template <> struct string_from_type<double>
+{ static std::string name() { return "d"; } };
+
+template <> struct string_from_type<long double>
+{ static std::string name() { return "e"; } };
+
+#if defined(HAVE_GMP)
+ template <> struct string_from_type<boost::numeric_adaptor::gmp_value_type>
+ { static std::string name() { return "g"; } };
+#endif
+
+#if defined(HAVE_CLN)
+ template <> struct string_from_type<boost::numeric_adaptor::cln_value_type>
+ { static std::string name() { return "c"; } };
+#endif
+
+
+
+#endif // GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP

Added: sandbox/geometry/libs/geometry/test/iterators/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,14 @@
+# ggl/test/iterators/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-iterators
+ :
+ [ run circular_iterator.cpp ]
+ [ run ever_circling_iterator.cpp ]
+ [ run segment_iterator.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/iterators/circular_iterator.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/circular_iterator.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,101 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithm>
+#include <iterator>
+#include <sstream>
+#include <string>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/iterators/circular_iterator.hpp>
+
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+
+template <typename G>
+void test_geometry(const std::string& wkt)
+{
+ G geo;
+ boost::geometry::read_wkt(wkt, geo);
+ typedef typename boost::range_const_iterator<G>::type normal_iterator;
+ typedef boost::geometry::circular_iterator<normal_iterator> circular_iterator;
+
+ circular_iterator end(boost::end(geo));
+
+ {
+ // 1: normal start position
+ normal_iterator start = boost::begin(geo);
+
+ std::ostringstream out;
+ for (circular_iterator it(boost::begin(geo), boost::end(geo), start);
+ it != end; ++it)
+ {
+ out << boost::geometry::get<0>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), "12345");
+ }
+
+ {
+ // 2: start somewhere in the middle
+ normal_iterator start = boost::begin(geo) + 2;
+
+ std::ostringstream out;
+ for (circular_iterator it(boost::begin(geo), boost::end(geo), start);
+ it != end; ++it)
+ {
+ out << boost::geometry::get<0>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), "34512");
+ }
+
+ {
+ // 3: start at end position
+ normal_iterator start = boost::begin(geo) + boost::size(geo) - 1;
+
+ std::ostringstream out;
+ for (circular_iterator it(boost::begin(geo), boost::end(geo), start);
+ it != end; ++it)
+ {
+ out << boost::geometry::get<0>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), "51234");
+ }
+
+ {
+ // 4: check copy behaviour
+ G copy;
+
+ {
+ normal_iterator start = boost::begin(geo) + 2;
+ circular_iterator it(boost::begin(geo), boost::end(geo), start);
+ std::copy<circular_iterator>(it, end, std::back_inserter(copy));
+ }
+
+ std::ostringstream out;
+ for (normal_iterator cit = boost::begin(copy); cit != boost::end(copy); ++cit)
+ {
+ out << boost::geometry::get<0>(*cit);
+ }
+ BOOST_CHECK_EQUAL(out.str(), "34512");
+ }
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::linestring<P> >("linestring(1 1,2 2,3 3,4 4,5 5)");
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_2d>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/iterators/circular_iterator.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/circular_iterator.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="circular_iterator"
+ ProjectGUID="{46571A34-B68D-4854-90C0-56D29EE63FFE}"
+ RootNamespace="circular_iterator"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\circular_iterator"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\circular_iterator"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\circular_iterator.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/iterators/ever_circling_iterator.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/ever_circling_iterator.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,80 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <sstream>
+#include <string>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/iterators/ever_circling_iterator.hpp>
+
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+
+template <typename G>
+void test_geometry(const std::string& wkt)
+{
+ G geo;
+ boost::geometry::read_wkt(wkt, geo);
+ typedef typename boost::range_const_iterator<G>::type iterator_type;
+
+
+ // Run 3 times through the geometry
+ int n = boost::size(geo) * 3;
+
+ {
+ std::ostringstream out;
+ boost::geometry::ever_circling_iterator<iterator_type> it(boost::begin(geo), boost::end(geo));
+ for (int i = 0; i < n; ++i, ++it)
+ {
+ out << boost::geometry::get<0>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), "123451234512345");
+ }
+
+ {
+ std::ostringstream out;
+ // Start somewhere
+ boost::geometry::ever_circling_iterator<iterator_type> it(
+ boost::begin(geo), boost::end(geo), boost::begin(geo) + 1);
+ for (int i = 0; i < n; ++i, ++it)
+ {
+ out << boost::geometry::get<0>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), "234512345123451");
+ }
+
+ {
+ std::ostringstream out;
+
+ // Navigate to somewhere
+ boost::geometry::ever_circling_iterator<iterator_type> it(boost::begin(geo), boost::end(geo));
+ for (int i = 0; i < n; ++i, ++it)
+ {
+ const int m = boost::size(geo);
+ it.moveto(boost::begin(geo) + m - (i % m) - 1);
+ out << boost::geometry::get<0>(*it);
+ }
+ BOOST_CHECK_EQUAL(out.str(), "543215432154321");
+ }
+
+}
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::linestring<P> >("linestring(1 1,2 2,3 3,4 4,5 5)");
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_2d>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/iterators/ever_circling_iterator.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/ever_circling_iterator.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ever_circling_iterator"
+ ProjectGUID="{73F8C969-FA1E-4D9D-81F9-35B1206F0C14}"
+ RootNamespace="ever_circling_iterator"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\ever_circling_iterator"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\ever_circling_iterator"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\ever_circling_iterator.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/iterators/iterators.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/iterators.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,37 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ever_circling_iterator", "ever_circling_iterator.vcproj", "{73F8C969-FA1E-4D9D-81F9-35B1206F0C14}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "circular_iterator", "circular_iterator.vcproj", "{46571A34-B68D-4854-90C0-56D29EE63FFE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment_iterator", "segment_iterator.vcproj", "{A38B1CA8-5194-4FAD-B85E-55697BEECCB7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ggl_headers", "..\ggl_headers.vcproj", "{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Debug|Win32.ActiveCfg = Debug|Win32
+ {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Debug|Win32.Build.0 = Debug|Win32
+ {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Release|Win32.ActiveCfg = Release|Win32
+ {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Release|Win32.Build.0 = Release|Win32
+ {46571A34-B68D-4854-90C0-56D29EE63FFE}.Debug|Win32.ActiveCfg = Debug|Win32
+ {46571A34-B68D-4854-90C0-56D29EE63FFE}.Debug|Win32.Build.0 = Debug|Win32
+ {46571A34-B68D-4854-90C0-56D29EE63FFE}.Release|Win32.ActiveCfg = Release|Win32
+ {46571A34-B68D-4854-90C0-56D29EE63FFE}.Release|Win32.Build.0 = Release|Win32
+ {A38B1CA8-5194-4FAD-B85E-55697BEECCB7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A38B1CA8-5194-4FAD-B85E-55697BEECCB7}.Debug|Win32.Build.0 = Debug|Win32
+ {A38B1CA8-5194-4FAD-B85E-55697BEECCB7}.Release|Win32.ActiveCfg = Release|Win32
+ {A38B1CA8-5194-4FAD-B85E-55697BEECCB7}.Release|Win32.Build.0 = Release|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.Build.0 = Debug|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.ActiveCfg = Release|Win32
+ {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/iterators/segment_iterator.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/segment_iterator.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,77 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Mateusz Loskot 2009, mateusz_at_[hidden]
+// Use, modification and distribution is subject to the 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 <algorithm>
+#include <list>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/geometries/cartesian2d.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/segment.hpp>
+#include <boost/geometry/iterators/segment_iterator.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+template <typename C>
+void test_linestring(const std::string& wkt, const std::string& expected)
+{
+ typedef C point_list;
+ typedef typename C::value_type point;
+ typedef typename C::iterator base_iterator;
+ typedef boost::geometry::segment_iterator<base_iterator, point> segment_iterator;
+ typedef typename segment_iterator::value_type segment;
+ typedef boost::geometry::linestring<point> linestring;
+
+ linestring g;
+ boost::geometry::read_wkt(wkt, g);
+
+ point_list v;
+ std::copy(g.begin(), g.end(), std::back_insert_iterator<point_list>(v));
+ BOOST_CHECK_EQUAL(g.size(), v.size());
+
+ segment_iterator it(v.begin(), v.end());
+ segment_iterator end(v.end());
+
+ std::ostringstream oss;
+ while (it != end)
+ {
+ segment const& s = *it;
+ oss << boost::geometry::get<0>(s.first) << boost::geometry::get<1>(s.first)
+ << boost::geometry::get<0>(s.second) << boost::geometry::get<1>(s.second);
+ ++it;
+ }
+ BOOST_CHECK_EQUAL(oss.str(), expected);
+}
+
+int test_main(int, char* [])
+{
+ // Test std::vector
+ typedef std::vector<boost::geometry::point_2d> points_v;
+ test_linestring<points_v>("linestring empty", "");
+ test_linestring<points_v>("linestring ()", "");
+ test_linestring<points_v>("linestring (1 1)", "");
+ test_linestring<points_v>("linestring (1 1, 2 2, 3 3)", "11222233");
+ test_linestring<points_v>("linestring (1 1, 2 2, 3 3, 4 4)", "112222333344");
+ test_linestring<points_v>("linestring (1 1, 2 2, 3 3, 4 4, 5 5, 6 6)", "11222233334444555566");
+
+ // Test std::list
+ typedef std::list<boost::geometry::point_2d> points_l;
+ test_linestring<points_l>("linestring empty", "");
+ test_linestring<points_l>("linestring ()", "");
+ test_linestring<points_l>("linestring (1 1)", "");
+ test_linestring<points_l>("linestring (1 1, 2 2, 3 3)", "11222233");
+ test_linestring<points_l>("linestring (1 1, 2 2, 3 3, 4 4)", "112222333344");
+ test_linestring<points_l>("linestring (1 1, 2 2, 3 3, 4 4, 5 5, 6 6)", "11222233334444555566");
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/iterators/segment_iterator.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/iterators/segment_iterator.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="segment_iterator"
+ ProjectGUID="{A38B1CA8-5194-4FAD-B85E-55697BEECCB7}"
+ RootNamespace="segment_iterator"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment_iterator"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment_iterator"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\segment_iterator.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,9 @@
+# test/arithmetic/Jamfile.v2
+#
+# Copyright (c) 2009 Barend Gehrels
+#
+# Use, modification and distribution is subject to the 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 algorithms ;
\ No newline at end of file

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,23 @@
+# test/arithmetic/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-multi-algorithms
+ :
+ [ run multi_area.cpp ]
+ [ run multi_centroid.cpp ]
+ [ run multi_convex_hull.cpp ]
+ [ run multi_correct.cpp ]
+ [ run multi_envelope.cpp ]
+ [ run multi_equals.cpp ]
+ [ run multi_for_each.cpp ]
+ [ run multi_intersection.cpp ]
+ [ run multi_length.cpp ]
+ [ run multi_perimeter.cpp ]
+ [ run multi_simplify.cpp ]
+ [ run multi_union.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_area.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_area.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,32 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <algorithms/test_area.hpp>
+
+#include <boost/geometry/multi/multi.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::multi_polygon<boost::geometry::polygon<P> > mp;
+ test_geometry<mp>("MULTIPOLYGON(((0 0,0 7,4 2,2 0,0 0)))", 16.0);
+}
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_area.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_area.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_area"
+ ProjectGUID="{691082ED-2778-4300-9860-42DFBBABE535}"
+ RootNamespace="multi_area"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_area"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_area"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_area.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,106 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithms/test_centroid.hpp>
+
+#include <boost/geometry/multi/algorithms/centroid.hpp>
+#include <boost/geometry/multi/strategies/centroid.hpp>
+#include <boost/geometry/multi/strategies/cartesian/centroid_average.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+
+
+// #define REPORT_RESULTS
+
+
+template <typename P>
+void test_2d(bool is_integer = false)
+{
+ typedef typename boost::geometry::coordinate_type<P>::type ct;
+#ifdef REPORT_RESULTS
+ std::cout << std::endl << "type: " << typeid(ct).name() << " size: " << sizeof(ct) << std::endl;
+#endif
+
+ if (! is_integer)
+ {
+ test_centroid<boost::geometry::multi_point<P> >(
+ "MULTIPOINT((1 1),(2 3),(5 0))",
+ 2.666666666666667, 1.33333);
+
+
+
+ // Only working for floating point:
+ test_centroid<boost::geometry::multi_polygon<boost::geometry::polygon<P> > >(
+ "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<boost::geometry::multi_polygon<boost::geometry::polygon<P> > >(
+ "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);
+ }
+
+
+
+ // 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<boost::geometry::multi_polygon<boost::geometry::polygon<P> > >(
+ "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);
+}
+
+
+
+int test_main(int, char* [])
+{
+ //test_2d<boost::geometry::point_xy<float> >();
+ test_2d<boost::geometry::point_xy<double> >();
+ test_2d<boost::geometry::point_xy<long int> >(true);
+ //test_2d<boost::geometry::point_xy<long long> >(true);
+ test_2d<boost::geometry::point_xy<long double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_centroid.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_centroid"
+ ProjectGUID="{7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}"
+ RootNamespace="multi_centroid"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_centroid"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_centroid"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_centroid.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,54 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <cstddef>
+#include <iterator>
+#include <string>
+
+#include <algorithms/test_convex_hull.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+#include <boost/geometry/multi/core/point_type.hpp>
+
+#include <boost/geometry/multi/iterators/range_type.hpp>
+
+#include <boost/geometry/multi/algorithms/num_points.hpp>
+#include <boost/geometry/multi/algorithms/convex_hull.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+
+
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::multi_point<P> mp;
+ typedef boost::geometry::multi_linestring<boost::geometry::linestring<P> > ml;
+ typedef boost::geometry::multi_polygon<boost::geometry::polygon<P> > mpoly;
+ test_geometry<mp>("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<ml>("multilinestring((2 4, 3 4, 3 5), (4 3,4 4,5 4))", 6, 5, 3.0);
+ test_geometry<mpoly>("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);
+}
+
+
+int test_main(int, char* [])
+{
+ //test_all<boost::geometry::point_xy<int> >();
+ //test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_convex_hull.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_convex_hull"
+ ProjectGUID="{B810C404-C4D9-4A6A-96B0-1DCED269D65D}"
+ RootNamespace="multi_convex_hull"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_convex_hull"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_convex_hull"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_convex_hull.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_correct.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_correct.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,58 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/correct.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/multi/algorithms/correct.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/linestring.hpp>
+#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+
+template <typename Geometry>
+void test_geometry(std::string const& wkt, std::string const& expected)
+{
+ Geometry geometry;
+
+ boost::geometry::read_wkt(wkt, geometry);
+ boost::geometry::correct(geometry);
+
+ std::ostringstream out;
+ out << boost::geometry::wkt(geometry);
+
+ BOOST_CHECK_EQUAL(out.str(), expected);
+}
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::multi_polygon<boost::geometry::polygon<P> > cw_type;
+ std::string cw_mp =
+ "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))";
+ test_geometry<cw_type>(cw_mp, cw_mp);
+
+ test_geometry<cw_type>("MULTIPOLYGON(((0 0,1 0,1 1,0 1,0 0)))",
+ cw_mp);
+}
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_correct.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_correct.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_correct"
+ ProjectGUID="{DFB00B88-2ED8-49CA-B739-7C8A8602D681}"
+ RootNamespace="multi_correct"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_correct"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_correct"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_correct.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_distance.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_distance.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,141 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <string>
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/distance.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+
+#include <boost/geometry/multi/algorithms/distance.hpp>
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename Geometry1, typename Geometry2>
+void test_distance(const std::string& wkt1, const std::string& wkt2, double expected)
+{
+ Geometry1 g1;
+ Geometry2 g2;
+ boost::geometry::read_wkt(wkt1, g1);
+ boost::geometry::read_wkt(wkt2, g2);
+ double d = boost::geometry::distance(g1, g2);
+
+ BOOST_CHECK_CLOSE(d, expected, 0.0001);
+}
+
+template <typename Geometry1, typename Geometry2, typename Strategy>
+void test_distance(const Strategy& strategy, const std::string& wkt1,
+ const std::string& wkt2, double expected)
+{
+ Geometry1 g1;
+ Geometry2 g2;
+ boost::geometry::read_wkt(wkt1, g1);
+ boost::geometry::read_wkt(wkt2, g2);
+ double d = boost::geometry::distance(g1, g2, strategy);
+
+ BOOST_CHECK_CLOSE(d, expected, 0.0001);
+}
+
+
+template <typename P>
+void test_2d()
+{
+ typedef boost::geometry::multi_point<P> mp;
+ typedef boost::geometry::multi_linestring<boost::geometry::linestring<P> > ml;
+ test_distance<P, P>("POINT(0 0)", "POINT(1 1)", sqrt(2.0));
+ test_distance<P, mp>("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<mp, P>("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+ test_distance<mp, mp>("MULTIPOINT((1 1),(1 0),(0 2))", "MULTIPOINT((2 2),(2 3))", sqrt(2.0));
+ test_distance<P, ml>("POINT(0 0)", "MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", 1.0);
+ test_distance<ml, P>("MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", "POINT(0 0)", 1.0);
+ test_distance<ml, mp>("MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", "MULTIPOINT((0 0),(1 1))", 0.0);
+
+ // Test with a strategy
+ boost::geometry::strategy::distance::pythagoras<P, P> pyth;
+ test_distance<P, P>(pyth, "POINT(0 0)", "POINT(1 1)", sqrt(2.0));
+ test_distance<P, mp>(pyth, "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<mp, P>(pyth, "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+}
+
+
+template <typename P>
+void test_3d()
+{
+ typedef boost::geometry::multi_point<P> mp;
+ test_distance<P, P>("POINT(0 0 0)", "POINT(1 1 1)", sqrt(3.0));
+ test_distance<P, mp>("POINT(0 0 0)", "MULTIPOINT((1 1 1),(1 0 0),(0 1 2))", 1.0);
+ test_distance<mp, mp>("MULTIPOINT((1 1 1),(1 0 0),(0 0 2))", "MULTIPOINT((2 2 2),(2 3 4))", sqrt(3.0));
+}
+
+
+template <typename P1, typename P2>
+void test_mixed()
+{
+ typedef boost::geometry::multi_point<P1> mp1;
+ typedef boost::geometry::multi_point<P2> mp2;
+
+ test_distance<P1, P2>("POINT(0 0)", "POINT(1 1)", sqrt(2.0));
+
+ test_distance<P1, mp1>("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<P1, mp2>("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<P2, mp1>("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<P2, mp2>("POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+
+ // Test automatic reversal
+ test_distance<mp1, P1>("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+ test_distance<mp1, P2>("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+ test_distance<mp2, P1>("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+ test_distance<mp2, P2>("MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+
+ // Test multi-multi using different point types for each
+ test_distance<mp1, mp2>("MULTIPOINT((1 1),(1 0),(0 2))", "MULTIPOINT((2 2),(2 3))", sqrt(2.0));
+
+ // Test with a strategy
+ using namespace boost::geometry::strategy::distance;
+
+ test_distance<P1, P2>(pythagoras<P1, P2>(), "POINT(0 0)", "POINT(1 1)", sqrt(2.0));
+
+ test_distance<P1, mp1>(pythagoras<P1, P1>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<P1, mp2>(pythagoras<P1, P2>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<P2, mp1>(pythagoras<P2, P1>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0);
+ test_distance<P2, mp2>(pythagoras<P2, P2>(), "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<mp1, P1>(pythagoras<P1, P1>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+ test_distance<mp1, P2>(pythagoras<P1, P2>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+ test_distance<mp2, P1>(pythagoras<P2, P1>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+ test_distance<mp2, P2>(pythagoras<P2, P2>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0);
+}
+
+
+
+int test_main( int , char* [] )
+{
+ test_2d<boost::tuple<float, float> >();
+ test_2d<boost::geometry::point_xy<float> >();
+ test_2d<boost::geometry::point_xy<double> >();
+
+ test_3d<boost::tuple<float, float, float> >();
+ test_3d<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> >();
+
+ test_mixed<boost::geometry::point_xy<float>, boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_distance.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_distance.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_distance"
+ ProjectGUID="{D770F3E8-0567-4EDD-91FC-20BA402A3F74}"
+ RootNamespace="multi_distance"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_distance"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_distance"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_distance.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_envelope.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_envelope.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,58 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <algorithms/test_envelope.hpp>
+
+
+#include <boost/geometry/multi/algorithms/envelope.hpp>
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+
+
+template <typename P>
+void test_2d()
+{
+ /*test_envelope<boost::geometry::multi_point<P> >(
+ "MULTIPOINT((1 1),(1 0),(1 2))", 1, 1, 0, 2);
+ test_envelope<boost::geometry::multi_linestring<boost::geometry::linestring<P> > >(
+ "MULTILINESTRING((0 0,1 1),(1 1,2 2),(2 2,3 3))", 0, 3, 0, 3);
+*/
+ test_envelope<boost::geometry::multi_polygon<boost::geometry::polygon<P> > >(
+ "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 <typename P>
+void test_3d()
+{
+ typedef boost::geometry::multi_point<P> mp;
+}
+
+
+int test_main( int , char* [] )
+{
+ test_2d<boost::tuple<float, float> >();
+ test_2d<boost::geometry::point_xy<float> >();
+ test_2d<boost::geometry::point_xy<double> >();
+
+ test_3d<boost::tuple<float, float, float> >();
+ test_3d<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_envelope.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_envelope.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_envelope"
+ ProjectGUID="{85385CF0-240C-4900-B5EA-E34D2415A18F}"
+ RootNamespace="multi_envelope"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_envelope"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_envelope"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_envelope.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_equals.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_equals.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,51 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 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 <algorithms/test_equals.hpp>
+
+#include <boost/geometry/multi/algorithms/equals.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+
+
+
+template <typename P>
+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 boost::geometry::polygon<P> polygon;
+ typedef boost::geometry::multi_polygon<polygon> mp;
+ test_geometry<mp, mp>("c1", case1, case1, true);
+
+ test_geometry<mp, mp>("c2",
+ "MULTIPOLYGON(((0 0,0 7.01,4 2,2 0,0 0)))",
+ case1, false);
+
+ // Different order == equal
+ test_geometry<mp, mp>("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<polygon, mp>("c1_p_mp", case1_p, case1, true);
+ test_geometry<mp, polygon>("c1_mp_p", case1, case1_p, true);
+
+}
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_equals.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_equals.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_equals"
+ ProjectGUID="{AA0EFD64-E034-421A-BD4A-E5A336D95C30}"
+ RootNamespace="multi_equals"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_equals"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_equals"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_equals.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_for_each.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_for_each.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,78 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/for_each.hpp>
+#include <boost/geometry/multi/algorithms/for_each.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/linestring.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <algorithms/test_for_each.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::multi_point<P> >
+ (
+ "MULTIPOINT((1 1))"
+
+ // per point
+ , 1
+ , "MULTIPOINT((101 1))"
+ , "MULTIPOINT((101 100))"
+ // per segment
+ , ""
+ , 0
+ , "MULTIPOINT((1 1))"
+ );
+
+ test_geometry<boost::geometry::multi_linestring<boost::geometry::linestring<P> > >
+ (
+ "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 boost::geometry::multi_polygon<boost::geometry::polygon<P> > mp;
+ test_geometry<mp>
+ (
+ "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)))"
+ );
+}
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_for_each.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_for_each.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_for_each"
+ ProjectGUID="{B016FE33-D587-45C6-8444-607839BB2C2D}"
+ RootNamespace="multi_for_each"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_for_each"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_for_each"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_for_each.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,51 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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 <iostream>
+#include <string>
+
+
+#include <algorithms/test_intersection.hpp>
+#include <algorithms/test_overlay.hpp>
+#include <multi/algorithms/overlay/multi_overlay_cases.hpp>
+
+#include <boost/geometry/multi/algorithms/intersection.hpp>
+
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ // polygon/multi polygon and ring/multi polygon are tested in union
+
+ namespace bg = boost::geometry;
+ typedef bg::polygon<P> polygon;
+ typedef bg::multi_polygon<polygon> multi_polygon;
+
+ test_one<polygon, multi_polygon, multi_polygon>("simplex_multi",
+ case_multi_simplex[0], case_multi_simplex[1],
+ 2, 12, 6.42);
+
+ test_one<polygon, multi_polygon, multi_polygon>("case_multi_no_ip",
+ case_multi_no_ip[0], case_multi_no_ip[1],
+ 2, 8, 8.5);
+ test_one<polygon, multi_polygon, multi_polygon>("case_multi_2",
+ case_multi_2[0], case_multi_2[1],
+ 3, 12, 5.9);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_intersection.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_intersection"
+ ProjectGUID="{FFB78F24-7999-4416-BDED-9C35A3DDF32D}"
+ RootNamespace="multi_intersection"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_intersection"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_intersection"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_intersection.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_length.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_length.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,31 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <algorithms/test_length.hpp>
+
+#include <boost/geometry/multi/multi.hpp>
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::multi_linestring<boost::geometry::linestring<P> > >
+ ("MULTILINESTRING((0 0,3 4,4 3))", 5 + sqrt(2.0));
+}
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_length.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_length.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_length"
+ ProjectGUID="{9087BA6C-7563-41E6-90AD-F60BC58DDC17}"
+ RootNamespace="multi_length"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_length"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_length"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_length.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_perimeter.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_perimeter.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,33 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/perimeter.hpp>
+#include <boost/geometry/multi/algorithms/perimeter.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/geometries/polygon.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <algorithms/test_perimeter.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::multi_polygon<boost::geometry::polygon<P> > >(
+ "MULTIPOLYGON(((0 0,0 1,1 0,0 0)))", 1.0 + 1.0 + sqrt(2.0));
+}
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_perimeter.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_perimeter.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_perimeter"
+ ProjectGUID="{D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}"
+ RootNamespace="multi_perimeter"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_perimeter"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_perimeter"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_perimeter.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_simplify.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_simplify.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,53 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/simplify.hpp>
+#include <boost/geometry/multi/algorithms/simplify.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/linear_ring.hpp>
+#include <boost/geometry/geometries/linestring.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/multi/geometries/multi_point.hpp>
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <algorithms/test_simplify.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ test_geometry<boost::geometry::multi_point<P> >(
+ "MULTIPOINT((0 0),(1 1))",
+ "MULTIPOINT((0 0),(1 1))", 1.0);
+
+ test_geometry<boost::geometry::multi_linestring<boost::geometry::linestring<P> > >(
+ "MULTILINESTRING((0 0,5 5,10 10))",
+ "MULTILINESTRING((0 0,10 10))", 1.0);
+
+ typedef boost::geometry::multi_polygon<boost::geometry::polygon<P> > mp;
+ test_geometry<mp>(
+ "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<mp>(
+ "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);
+}
+
+int test_main( int , char* [] )
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_simplify.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_simplify.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_simplify"
+ ProjectGUID="{76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}"
+ RootNamespace="multi_simplify"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_simplify"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_simplify"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_simplify.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,66 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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 <iostream>
+#include <string>
+
+
+#include <algorithms/test_union.hpp>
+#include <algorithms/test_overlay.hpp>
+#include <multi/algorithms/overlay/multi_overlay_cases.hpp>
+
+#include <boost/geometry/multi/algorithms/union.hpp>
+
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ namespace bg = boost::geometry;
+ typedef bg::linear_ring<P> ring;
+ typedef bg::polygon<P> polygon;
+ typedef bg::multi_polygon<polygon> multi_polygon;
+
+ test_one<polygon, multi_polygon, multi_polygon>("simplex_multi",
+ case_multi_simplex[0], case_multi_simplex[1],
+ 1, 0, 20, 14.58);
+
+ test_one<polygon, polygon, multi_polygon>("simplex_multi_p_mp",
+ case_single_simplex, case_multi_simplex[0],
+ 1, 0, 20, 14.58);
+ test_one<polygon, multi_polygon, polygon>("simplex_multi_mp_p",
+ case_multi_simplex[0], case_single_simplex,
+ 1, 0, 20, 14.58);
+
+ test_one<polygon, ring, multi_polygon>("simplex_multi_r_mp",
+ case_single_simplex, case_multi_simplex[0],
+ 1, 0, 20, 14.58);
+ test_one<ring, multi_polygon, polygon>("simplex_multi_mp_r",
+ case_multi_simplex[0], case_single_simplex,
+ 1, 0, 20, 14.58);
+
+
+ // Normal test cases
+ test_one<polygon, multi_polygon, multi_polygon>("case_multi_no_ip",
+ case_multi_no_ip[0], case_multi_no_ip[1],
+ 4, 0, 16, 66.5);
+ test_one<polygon, multi_polygon, multi_polygon>("case_multi_2",
+ case_multi_2[0], case_multi_2[1],
+ 3, 0, 16, 59.1);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point_xy<double> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_union"
+ ProjectGUID="{1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}"
+ RootNamespace="multi_union"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_union"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_union"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../..;."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_union.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,55 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels, Geodan B.V. 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#include <boost/geometry/algorithms/correct.hpp>
+#include <boost/geometry/algorithms/within.hpp>
+
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/multi/algorithms/within.hpp>
+
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <algorithms/test_within.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::multi_polygon<boost::geometry::polygon<P> > mp;
+
+ // trivial cases
+ test_geometry<P, mp>("POINT(1 1)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", true);
+ test_geometry<P, mp>("POINT(3 3)", "MULTIPOLYGON(((0 0,0 2,2 2,2 0,0 0)))", false);
+
+ // test if it is in one of them
+ test_geometry<P, mp>("POINT(4 4)", "MULTIPOLYGON("
+ "((0 0,0 2,2 2,2 0,0 0))"
+ "((3 3,3 6,6 6,6 3,3 3))"
+ ")",
+ true);
+}
+
+int test_main( int , char* [] )
+{
+ //test_all<boost::geometry::point_xy<int> >();
+ test_all<boost::geometry::point_xy<double> >();
+
+#if defined(HAVE_CLN)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::cln_value_type> >();
+#endif
+#if defined(HAVE_GMP)
+ test_all<boost::geometry::point_xy<boost::numeric_adaptor::gmp_value_type> >();
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_within.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_within"
+ ProjectGUID="{CA8D5E44-7D8F-44A1-901C-35C28890299B}"
+ RootNamespace="multi_within"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_within"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_within"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_within.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_traverse", "multi_traverse.vcproj", "{DB00BBA3-4959-4F9E-A235-E487FF766207}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DB00BBA3-4959-4F9E-A235-E487FF766207}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DB00BBA3-4959-4F9E-A235-E487FF766207}.Debug|Win32.Build.0 = Debug|Win32
+ {DB00BBA3-4959-4F9E-A235-E487FF766207}.Release|Win32.ActiveCfg = Release|Win32
+ {DB00BBA3-4959-4F9E-A235-E487FF766207}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_cases.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,32 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 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_MULTI_OVERLAY_CASES_HPP
+#define BOOST_GEOMETRY_TEST_MULTI_OVERLAY_CASES_HPP
+
+
+#include <string>
+
+
+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)))" };
+
+
+
+#endif // BOOST_GEOMETRY_TEST_MULTI_OVERLAY_CASES_HPP

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_common.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_overlay_common.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,39 @@
+#ifndef GGL_TEST_MULTI_OVERLAY_COMMON_HPP
+#define GGL_TEST_MULTI_OVERLAY_COMMON_HPP
+
+
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+//#include <boost/geometry/multi/io/svg/write_svg.hpp>
+
+
+
+template <typename P, typename Functor, typename T>
+void test_all(std::vector<T> const& expected, double precision = 0.01)
+{
+ typename boost::range_const_iterator<std::vector<T> >::type iterator
+ = boost::begin(expected);
+
+ typedef boost::geometry::multi_polygon<boost::geometry::polygon<P> > mp;
+ typedef boost::geometry::box<P> box;
+
+ BOOST_ASSERT(iterator != boost::end(expected));
+ test_overlay<mp, mp, Functor>("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 // GGL_TEST_MULTI_OVERLAY_COMMON_HPP

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_svg_mapper.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_svg_mapper.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,44 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 GGL_TEST_MULTI_UTIL_SVG_MAPPER_HPP
+#define GGL_TEST_MULTI_UTIL_SVG_MAPPER_HPP
+
+#include <boost/geometry/multi/algorithms/envelope.hpp>
+#include <boost/geometry/multi/algorithms/transform.hpp>
+
+#include <boost/geometry/extensions/io/svg/write_svg_multi.hpp>
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+
+template <typename MultiPolygon>
+struct svg_map<boost::geometry::multi_polygon_tag, true, MultiPolygon>
+{
+ template <typename TransformStrategy>
+ static inline void apply(std::ostream& stream,
+ std::string const& style, int size,
+ MultiPolygon const& multi_polygon,
+ TransformStrategy const& strategy)
+ {
+ boost::geometry::multi_polygon<boost::geometry::polygon<boost::geometry::point_xy<int> > > impoly;
+ boost::geometry::transform(multi_polygon, impoly, strategy);
+ stream << boost::geometry::svg(impoly, style, size) << std::endl;
+ }
+};
+
+
+} // namespace dispatch
+#endif
+
+
+
+#endif // GGL_TEST_MULTI_UTIL_SVG_MAPPER_HPP

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,89 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 the single-geometry version
+#define BOOST_GEOMETRY_TEST_MULTI
+#include "traverse.cpp"
+
+
+#include <boost/geometry/multi/core/ring_type.hpp>
+
+#include <boost/geometry/multi/algorithms/num_points.hpp>
+#include <boost/geometry/multi/algorithms/overlay/get_turns.hpp>
+#include <boost/geometry/multi/algorithms/overlay/copy_segments.hpp>
+#include <boost/geometry/multi/algorithms/overlay/copy_segment_point.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/get_full_section.hpp>
+
+#include <boost/geometry/multi/geometries/multi_linestring.hpp>
+#include <boost/geometry/multi/geometries/multi_polygon.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
+
+
+#include "multi_overlay_cases.hpp"
+#include "multi_svg_mapper.hpp"
+
+
+// Because multi-intersections are similar to single,
+// we don't have to test all cases.
+// We only check "double" and the simplex (two triangles)
+// and cases which are specific to multi (if any)
+
+
+template <typename T>
+void test_all()
+{
+ namespace bg = boost::geometry;
+ namespace ov = boost::geometry::detail::overlay;
+
+ typedef bg::multi_polygon
+ <
+ bg::polygon
+ <
+ bg::point<T, 2, bg::cs::cartesian>
+ >
+ > multi_polygon;
+
+ typedef boost::tuple<int, double> Tuple;
+
+ test_overlay<multi_polygon, multi_polygon,
+ test_traverse<ov::operation_intersection>, Tuple>
+ (
+ "simplex", boost::make_tuple(2, 6.42),
+ case_multi_simplex[0], case_multi_simplex[1]
+ );
+
+ test_overlay<multi_polygon, multi_polygon,
+ test_traverse<ov::operation_union>, Tuple>
+ (
+ "simplex", boost::make_tuple(1, 14.58),
+ case_multi_simplex[0], case_multi_simplex[1]
+ );
+
+ // Bug found with "recursive boxes"
+ // TODO: Solve this bug
+ /***
+ test_overlay<multi_polygon, multi_polygon,
+ test_traverse<ov::operation_union>, Tuple>
+ (
+ "recursive_box1", boost::make_tuple(1, 14.58),
+ "MULTIPOLYGON(((3 9,3 10,4 10,4 9,3 9)),((1 1,1 2,2 2,2 1,1 1)),((7 8,7 9,8 9,8 8,7 8)),((8 0,8 1,9 1,9 0,8 0)))",
+ "MULTIPOLYGON(((0 1,0 2,1 2,1 1,0 1)),((7 5,7 6,8 6,8 5,7 5)),((1 1,1 1,2 1,2 1,2 0,2 0,1 0,1 0,1 0,1 1)))"
+ );
+ ***/
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<double>();
+
+ return 0;
+}
+
+

Added: sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/overlay/multi_traverse.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="multi_traverse"
+ ProjectGUID="{DB00BBA3-4959-4F9E-A235-E487FF766207}"
+ RootNamespace="multi_traverse"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_traverse"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../..;../../../../../..;../../../algorithms/overlay"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\multi_traverse"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../..;../../../../../..;../../../algorithms/overlay"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\multi_traverse.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/multi/multi_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/multi/multi_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,97 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_within", "algorithms\multi_within.vcproj", "{CA8D5E44-7D8F-44A1-901C-35C28890299B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_distance", "algorithms\multi_distance.vcproj", "{D770F3E8-0567-4EDD-91FC-20BA402A3F74}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_convex_hull", "algorithms\multi_convex_hull.vcproj", "{B810C404-C4D9-4A6A-96B0-1DCED269D65D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_envelope", "algorithms\multi_envelope.vcproj", "{85385CF0-240C-4900-B5EA-E34D2415A18F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_centroid", "algorithms\multi_centroid.vcproj", "{7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_correct", "algorithms\multi_correct.vcproj", "{DFB00B88-2ED8-49CA-B739-7C8A8602D681}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_simplify", "algorithms\multi_simplify.vcproj", "{76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_for_each", "algorithms\multi_for_each.vcproj", "{B016FE33-D587-45C6-8444-607839BB2C2D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_area", "algorithms\multi_area.vcproj", "{691082ED-2778-4300-9860-42DFBBABE535}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_length", "algorithms\multi_length.vcproj", "{9087BA6C-7563-41E6-90AD-F60BC58DDC17}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_perimeter", "algorithms\multi_perimeter.vcproj", "{D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_intersection", "algorithms\multi_intersection.vcproj", "{FFB78F24-7999-4416-BDED-9C35A3DDF32D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_union", "algorithms\multi_union.vcproj", "{1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_equals", "algorithms\multi_equals.vcproj", "{AA0EFD64-E034-421A-BD4A-E5A336D95C30}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32
+ {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32
+ {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Release|Win32.Build.0 = Release|Win32
+ {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Debug|Win32.Build.0 = Debug|Win32
+ {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Release|Win32.ActiveCfg = Release|Win32
+ {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Release|Win32.Build.0 = Release|Win32
+ {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Debug|Win32.Build.0 = Debug|Win32
+ {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Release|Win32.ActiveCfg = Release|Win32
+ {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Release|Win32.Build.0 = Release|Win32
+ {85385CF0-240C-4900-B5EA-E34D2415A18F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {85385CF0-240C-4900-B5EA-E34D2415A18F}.Debug|Win32.Build.0 = Debug|Win32
+ {85385CF0-240C-4900-B5EA-E34D2415A18F}.Release|Win32.ActiveCfg = Release|Win32
+ {85385CF0-240C-4900-B5EA-E34D2415A18F}.Release|Win32.Build.0 = Release|Win32
+ {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Debug|Win32.Build.0 = Debug|Win32
+ {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Release|Win32.ActiveCfg = Release|Win32
+ {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Release|Win32.Build.0 = Release|Win32
+ {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Debug|Win32.Build.0 = Debug|Win32
+ {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Release|Win32.ActiveCfg = Release|Win32
+ {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Release|Win32.Build.0 = Release|Win32
+ {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Debug|Win32.Build.0 = Debug|Win32
+ {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Release|Win32.ActiveCfg = Release|Win32
+ {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Release|Win32.Build.0 = Release|Win32
+ {B016FE33-D587-45C6-8444-607839BB2C2D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {B016FE33-D587-45C6-8444-607839BB2C2D}.Debug|Win32.Build.0 = Debug|Win32
+ {B016FE33-D587-45C6-8444-607839BB2C2D}.Release|Win32.ActiveCfg = Release|Win32
+ {B016FE33-D587-45C6-8444-607839BB2C2D}.Release|Win32.Build.0 = Release|Win32
+ {691082ED-2778-4300-9860-42DFBBABE535}.Debug|Win32.ActiveCfg = Debug|Win32
+ {691082ED-2778-4300-9860-42DFBBABE535}.Debug|Win32.Build.0 = Debug|Win32
+ {691082ED-2778-4300-9860-42DFBBABE535}.Release|Win32.ActiveCfg = Release|Win32
+ {691082ED-2778-4300-9860-42DFBBABE535}.Release|Win32.Build.0 = Release|Win32
+ {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Debug|Win32.Build.0 = Debug|Win32
+ {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Release|Win32.ActiveCfg = Release|Win32
+ {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Release|Win32.Build.0 = Release|Win32
+ {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Debug|Win32.Build.0 = Debug|Win32
+ {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Release|Win32.ActiveCfg = Release|Win32
+ {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Release|Win32.Build.0 = Release|Win32
+ {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Debug|Win32.Build.0 = Debug|Win32
+ {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Release|Win32.ActiveCfg = Release|Win32
+ {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Release|Win32.Build.0 = Release|Win32
+ {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Debug|Win32.ActiveCfg = Debug|Win32
+ {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Debug|Win32.Build.0 = Debug|Win32
+ {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Release|Win32.ActiveCfg = Release|Win32
+ {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Release|Win32.Build.0 = Release|Win32
+ {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Debug|Win32.Build.0 = Debug|Win32
+ {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Release|Win32.ActiveCfg = Release|Win32
+ {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/point_concept/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,20 @@
+# test/point_concept/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-point-concept
+ :
+ [ compile concept_checker.cpp ]
+ [ compile well_formed_point.cpp ]
+ [ compile well_formed_point_traits.cpp ]
+ [ compile array_point.cpp ]
+ [ compile-fail point_without_coordinate_type.cpp ]
+ [ compile-fail point_without_dimension.cpp ]
+ [ compile-fail point_without_getter.cpp ]
+ [ compile-fail point_without_setter.cpp ]
+ [ compile-fail point_with_incorrect_dimension.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/point_concept/array_point.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/array_point.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,20 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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_common/test_point.hpp>
+
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include "function_requiring_a_point.hpp"
+
+int main()
+{
+ float p1[3] = { 0, 0, 0 };
+ const float p2[3] = { 0, 0, 0 };
+ test::function_requiring_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/concept_checker.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/concept_checker.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,70 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/core/cs.hpp>
+#include <boost/geometry/geometries/concepts/check.hpp>
+
+struct ro_point
+{
+ float x, y;
+};
+
+
+struct rw_point
+{
+ float x, y;
+};
+
+
+namespace boost { namespace geometry { namespace traits {
+
+template <> struct tag<ro_point> { typedef point_tag type; };
+template <> struct coordinate_type<ro_point> { typedef float type; };
+template <> struct coordinate_system<ro_point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<ro_point> { enum { value = 2 }; };
+
+template <> struct access<ro_point, 0>
+{
+ static float get(ro_point const& p) { return p.x; }
+};
+
+template <> struct access<ro_point, 1>
+{
+ static float get(ro_point const& p) { return p.y; }
+};
+
+
+
+
+template <> struct tag<rw_point> { typedef point_tag type; };
+template <> struct coordinate_type<rw_point> { typedef float type; };
+template <> struct coordinate_system<rw_point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<rw_point> { enum { value = 2 }; };
+
+template <> struct access<rw_point, 0>
+{
+ static float get(rw_point const& p) { return p.x; }
+ static void set(rw_point& p, float value) { p.x = value; }
+};
+
+template <> struct access<rw_point, 1>
+{
+ static float get(rw_point const& p) { return p.y; }
+ static void set(rw_point& p, float value) { p.y = value; }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+
+int main()
+{
+ boost::geometry::concept::check<const ro_point>();
+ boost::geometry::concept::check<rw_point>();
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/function_asserting_a_point.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/function_asserting_a_point.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,28 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept unit tests
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 GGL_TEST_POINT_CONCEPT_FUNCTION_ASSERTING_A_POINT_HPP
+#define GGL_TEST_POINT_CONCEPT_FUNCTION_ASSERTING_A_POINT_HPP
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/geometry/geometries/concepts/point_concept.hpp>
+
+namespace test
+{
+ template <typename P, typename CP>
+ void function_asserting_a_point(P& p1, const CP& p2)
+ {
+ BOOST_CONCEPT_ASSERT((boost::geometry::concept::Point<P>));
+ BOOST_CONCEPT_ASSERT((boost::geometry::concept::ConstPoint<P>));
+
+ get<0>(p1) = get<0>(p2);
+ }
+}
+
+#endif // GGL_TEST_POINT_CONCEPT_FUNCTION_ASSERTING_A_POINT_HPP

Added: sandbox/geometry/libs/geometry/test/point_concept/function_requiring_a_point.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/function_requiring_a_point.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,30 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept unit tests
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 GGL_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP
+#define GGL_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP
+
+#include <boost/concept/requires.hpp>
+
+#include <boost/geometry/geometries/concepts/point_concept.hpp>
+
+namespace test
+{
+ template <typename P, typename C>
+
+ inline BOOST_CONCEPT_REQUIRES(
+ ((boost::geometry::concept::Point<P>))
+ ((boost::geometry::concept::ConstPoint<C>)),
+ (void))
+ function_requiring_a_point(P& p1, const C& p2)
+ {
+ boost::geometry::set<0>(p1, boost::geometry::get<0>(p2));
+ }
+}
+
+#endif // GGL_TEST_POINT_CONCEPT_FUNCTION_REQUIRING_A_POINT_HPP

Added: sandbox/geometry/libs/geometry/test/point_concept/point_with_incorrect_dimension.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/point_with_incorrect_dimension.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,52 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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_common/test_point.hpp>
+
+#include "function_asserting_a_point.hpp"
+#include "function_requiring_a_point.hpp"
+
+#include <boost/geometry/core/cs.hpp>
+
+struct point
+{
+ float x, y;
+};
+
+namespace boost { namespace geometry { namespace traits {
+
+template <> struct tag<point> { typedef point_tag type; };
+template <> struct coordinate_type<point> { typedef float type; };
+template <> struct coordinate_system<point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<point> { enum { value = 3 }; };
+
+template <> struct access<point, 0>
+{
+ static float get(point const& p) { return p.x; }
+ static void set(point& p, float value) { p.x = value; }
+};
+
+template <> struct access<point, 1>
+{
+ static float get(point const& p) { return p.y; }
+ static void set(point& p, float value) { p.y = value; }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ test::function_requiring_a_point(p1, p2);
+ test::function_asserting_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/point_without_coordinate_type.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/point_without_coordinate_type.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,47 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/core/cs.hpp>
+
+struct point
+{
+ float x, y;
+};
+
+namespace boost { namespace geometry { namespace traits {
+
+template <> struct tag<point> { typedef point_tag type; };
+//template <> struct coordinate_type<point> { typedef float type; };
+template <> struct coordinate_system<point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<point> { enum { value = 2 }; };
+
+template <> struct access<point, 0>
+{
+ static float get(point const& p) { return p.x; }
+ static void set(point& p, float value) { p.x = value; }
+};
+
+template <> struct access<point, 1>
+{
+ static float get(point const& p) { return p.y; }
+ static void set(point& p, float value) { p.y = value; }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+int main()
+{
+ point p1;
+ const point p2;
+ test::function_requiring_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/point_without_dimension.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/point_without_dimension.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,49 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/core/cs.hpp>
+
+struct point
+{
+ float x, y;
+};
+
+
+namespace boost { namespace geometry { namespace traits {
+
+template <> struct tag<point> { typedef point_tag type; };
+template <> struct coordinate_type<point> { typedef float type; };
+template <> struct coordinate_system<point> { typedef boost::geometry::cs::cartesian type; };
+//template <> struct dimension<point> { enum { value = 2 }; };
+
+template <> struct access<point, 0>
+{
+ static float get(point const& p) { return p.x; }
+ static void set(point& p, float value) { p.x = value; }
+};
+
+template <> struct access<point, 1>
+{
+ static float get(point const& p) { return p.y; }
+ static void set(point& p, float value) { p.y = value; }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+
+int main()
+{
+ point p1;
+ const point p2;
+ test::function_requiring_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/point_without_getter.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/point_without_getter.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,45 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/core/cs.hpp>
+
+struct point
+{
+ float x, y;
+};
+
+namespace boost { namespace geometry { namespace traits {
+
+template <> struct tag<point> { typedef point_tag type; };
+template <> struct coordinate_type<point> { typedef float type; };
+template <> struct coordinate_system<point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<point> { enum { value = 2 }; };
+
+template <> struct access<point, 0>
+{
+ static void set(point& p, float value) { p.x = value; }
+};
+
+template <> struct access<point, 1>
+{
+ static void set(point& p, float value) { p.y = value; }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+int main()
+{
+ point p1;
+ const point p2;
+ test::function_requiring_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/point_without_setter.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/point_without_setter.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,45 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/core/cs.hpp>
+
+struct point
+{
+ float x, y;
+};
+
+namespace boost { namespace geometry { namespace traits {
+
+template <> struct tag<point> { typedef point_tag type; };
+template <> struct coordinate_type<point> { typedef float type; };
+template <> struct coordinate_system<point> { typedef boost::geometry::cs::cartesian type; };
+template <> struct dimension<point> { enum { value = 2 }; };
+
+template <> struct access<point, 0>
+{
+ static float get(point const& p) { return p.x; }
+};
+
+template <> struct access<point, 1>
+{
+ static float get(point const& p) { return p.y; }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+int main()
+{
+ point p1;
+ const point p2;
+ test::function_requiring_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/well_formed_point.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/well_formed_point.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,28 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/tuple/tuple.hpp>
+
+#include <boost/geometry/core/cs.hpp>
+#include <boost/geometry/geometries/register/point.hpp>
+
+#include "function_requiring_a_point.hpp"
+
+struct point: public boost::tuple<float, float>
+{
+};
+
+BOOST_GEOMETRY_REGISTER_POINT_2D(point, float, cs::cartesian, get<0>(), get<1>())
+
+int main()
+{
+ point p1;
+ const point p2;
+ test::function_requiring_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/point_concept/well_formed_point_traits.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/point_concept/well_formed_point_traits.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,82 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) Point concept test file
+//
+// Copyright Bruno Lalande 2008, 2009
+// Copyright Barend Gehrels 2007-2009, 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 <boost/geometry/core/cs.hpp>
+
+#include "function_requiring_a_point.hpp"
+
+struct point
+{
+ point(): x(), y() {}
+ float x, y;
+};
+
+namespace boost { namespace geometry { namespace traits {
+
+template <>
+struct tag<point>
+{
+ typedef point_tag type;
+};
+
+template <>
+struct coordinate_type<point>
+{
+ typedef float type;
+};
+
+template <>
+struct coordinate_system<point>
+{
+ typedef boost::geometry::cs::cartesian type;
+};
+
+template <>
+struct dimension<point>
+{
+ enum { value = 2 };
+};
+
+template <>
+struct access<point, 0>
+{
+ static float get(point const& p)
+ {
+ return p.x;
+ }
+
+ static void set(point& p, float value)
+ {
+ p.x = value;
+ }
+};
+
+template <>
+struct access<point, 1>
+{
+ static float get(point const& p)
+ {
+ return p.y;
+ }
+
+ static void set(point& p, float value)
+ {
+ p.y = value;
+ }
+};
+
+
+}}} // namespace boost::geometry::traits
+
+int main()
+{
+ point p1;
+ const point p2;
+ test::function_requiring_a_point(p1, p2);
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/policies/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/policies/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,12 @@
+# test/util/Jamfile.v2
+#
+# Copyright (c) 2009 Barend Gehrels
+#
+# Use, modification and distribution is subject to the 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 ggl-policies
+ :
+ [ run compare.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/policies/compare.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/policies/compare.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,240 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+#include <algorithm>
+
+#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/util/write_dsv.hpp>
+
+#include <boost/geometry/policies/compare.hpp>
+
+#include <boost/geometry/strategies/strategies.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <test_common/test_point.hpp>
+
+
+template <typename Container>
+inline std::string coordinates(Container const& points)
+{
+ std::ostringstream out;
+ typedef typename boost::range_value<Container>::type point_type;
+ for (typename boost::range_const_iterator<Container>::type it = boost::begin(points);
+ it != boost::end(points);
+ ++it)
+ {
+ out << boost::geometry::dsv(*it);
+ }
+ return out.str();
+}
+
+template <typename P>
+void test_2d_compare()
+{
+ P p1 = boost::geometry::make<P>(3, 1);
+ P p2 = boost::geometry::make<P>(3, 1);
+ P p3 = boost::geometry::make<P>(1, 3);
+ P p4 = boost::geometry::make<P>(5, 2);
+ P p5 = boost::geometry::make<P>(3, 2);
+
+ // Test in all dimensions
+ {
+ boost::geometry::equal_to<P> et;
+ boost::geometry::less<P> lt;
+ boost::geometry::greater<P> 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
+ {
+ boost::geometry::equal_to<P, 0> et;
+ boost::geometry::less<P, 0> lt;
+ boost::geometry::greater<P, 0> 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
+ {
+ boost::geometry::equal_to<P, 1> et;
+ boost::geometry::less<P, 1> lt;
+ boost::geometry::greater<P, 1> 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 <typename P>
+void test_2d_sort()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type ct;
+
+ std::vector<P> v;
+ v.push_back(boost::geometry::make<P>(3, 1));
+ v.push_back(boost::geometry::make<P>(2, 3));
+ v.push_back(boost::geometry::make<P>(2, 2));
+ v.push_back(boost::geometry::make<P>(1, 3));
+
+ // Sort on coordinates in order x,y,z
+ std::sort(v.begin(), v.end(), boost::geometry::less<P>());
+ 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(), boost::geometry::greater<P>());
+ 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(), boost::geometry::greater<P>());
+ //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(boost::geometry::make<P>(4, 1));
+ v.push_back(boost::geometry::make<P>(3, 2));
+ v.push_back(boost::geometry::make<P>(2, 3));
+ v.push_back(boost::geometry::make<P>(1, 4));
+
+ // Sort ascending on only x-coordinate
+ std::sort(v.begin(), v.end(), boost::geometry::less<P, 0>());
+ 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(), boost::geometry::less<P, 1>());
+ 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(), boost::geometry::greater<P, 0>());
+ 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(), boost::geometry::greater<P, 1>());
+ s = coordinates(v);
+ BOOST_CHECK_EQUAL(s, "(1, 4)(2, 3)(3, 2)(4, 1)");
+
+ // Make non-unique vector
+ v.push_back(boost::geometry::make<P>(4, 1));
+ v.push_back(boost::geometry::make<P>(3, 2));
+ v.push_back(boost::geometry::make<P>(2, 3));
+ v.push_back(boost::geometry::make<P>(1, 4));
+ v.push_back(boost::geometry::make<P>(1, 5));
+ std::sort(v.begin(), v.end(), boost::geometry::less<P>());
+ 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<P> v2;
+ std::unique_copy(v.begin(), v.end(), std::back_inserter(v2), boost::geometry::equal_to<P>());
+ s = coordinates(v2);
+ BOOST_CHECK_EQUAL(s, "(1, 4)(1, 5)(2, 3)(3, 2)(4, 1)");
+}
+
+
+template <typename P>
+void test_spherical()
+{
+ typedef typename boost::geometry::coordinate_type<P>::type ct;
+
+ std::vector<P> v;
+ v.push_back(boost::geometry::make<P>( 179.73, 71.56)); // east
+ v.push_back(boost::geometry::make<P>( 177.47, 71.23)); // less east
+ v.push_back(boost::geometry::make<P>(-178.78, 70.78)); // further east, = west, this is the most right point
+
+ // Sort on coordinates in order x,y,z
+ std::sort(v.begin(), v.end(), boost::geometry::less<P>());
+ std::string s = coordinates(v);
+ BOOST_CHECK_EQUAL(s, "(177.47, 71.23)(179.73, 71.56)(-178.78, 70.78)");
+
+ // Sort ascending on only x-coordinate
+ std::sort(v.begin(), v.end(), boost::geometry::less<P, 0>());
+ s = coordinates(v);
+ BOOST_CHECK_EQUAL(s, "(177.47, 71.23)(179.73, 71.56)(-178.78, 70.78)");
+
+ // 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(), boost::geometry::less<P, 0, std::less<ct> >());
+ 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<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_2d_compare<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ test_2d_sort<boost::geometry::point<int, 2, boost::geometry::cs::cartesian> >();
+ test_2d_sort<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_2d_sort<boost::tuple<double, double> >();
+ test_2d_sort<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ test_spherical<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/policies/compare.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/policies/compare.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="compare"
+ ProjectGUID="{71AFA3C2-6873-4368-81D9-CA305A43B458}"
+ RootNamespace="compare"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\compare"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\compare"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\compare.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/policies/policy_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/policies/policy_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,19 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compare", "compare.vcproj", "{71AFA3C2-6873-4368-81D9-CA305A43B458}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {71AFA3C2-6873-4368-81D9-CA305A43B458}.Debug|Win32.ActiveCfg = Debug|Win32
+ {71AFA3C2-6873-4368-81D9-CA305A43B458}.Debug|Win32.Build.0 = Debug|Win32
+ {71AFA3C2-6873-4368-81D9-CA305A43B458}.Release|Win32.ActiveCfg = Release|Win32
+ {71AFA3C2-6873-4368-81D9-CA305A43B458}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/strategies/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,16 @@
+# test/strategies/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-strategies
+ :
+ [ run cross_track.cpp ]
+ [ run haversine.cpp ]
+ [ run projected_point.cpp ]
+ [ run pythagoras.cpp ]
+ [ run transformer.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/strategies/cross_track.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/cross_track.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,71 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/strategies/spherical/distance_haversine.hpp>
+#include <boost/geometry/strategies/spherical/distance_cross_track.hpp>
+
+#include <boost/geometry/strategies/concepts/distance_concept.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/segment.hpp>
+
+
+template <typename Point>
+void test_distance(double lon1, double lat1,
+ double lon2, double lat2,
+ double lon3, double lat3,
+ double radius, double expected, double tolerance)
+{
+ typedef boost::geometry::strategy::distance::cross_track
+ <
+ Point,
+ Point
+ > strategy_type;
+
+
+ BOOST_CONCEPT_ASSERT
+ (
+ (boost::geometry::concept::PointSegmentDistanceStrategy<strategy_type>)
+ );
+
+
+ strategy_type strategy(radius);
+
+ Point p1, p2, p3;
+ boost::geometry::assign(p1, lon1, lat1);
+ boost::geometry::assign(p2, lon2, lat2);
+ boost::geometry::assign(p3, lon3, lat3);
+ typename strategy_type::return_type d = strategy.apply(p1, p2, p3);
+
+ BOOST_CHECK_CLOSE((double) d, expected, tolerance);
+}
+
+template <typename Point>
+void test_all()
+{
+ double const average_earth_radius = 6372795.0;
+
+ // distance (Paris <-> Amsterdam/Barcelona), ~87 km
+ // should be is equal
+ // to distance (Paris <-> Barcelona/Amsterdam)
+ double const p_to_ab = 86.8 * 1000.0;
+ test_distance<Point>(2, 48, 4, 52, 2, 41, average_earth_radius, p_to_ab, 1.0);
+ test_distance<Point>(2, 48, 2, 41, 4, 52, average_earth_radius, p_to_ab, 1.0);
+}
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/cross_track.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/cross_track.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="cross_track"
+ ProjectGUID="{4CE6F112-9EA1-4D7E-9AC6-907E77895263}"
+ RootNamespace="cross_track"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\cross_track"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\cross_track"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\cross_track.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/strategies/haversine.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/haversine.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,81 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/concept/requires.hpp>
+#include <boost/concept_check.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/strategies/spherical/distance_haversine.hpp>
+#include <boost/geometry/strategies/concepts/distance_concept.hpp>
+
+
+#include <boost/geometry/geometries/point.hpp>
+
+
+template <typename Point>
+struct test_distance
+{
+ typedef boost::geometry::strategy::distance::haversine
+ <
+ Point,
+ Point
+ > haversine_type;
+
+
+ BOOST_CONCEPT_ASSERT
+ (
+ (boost::geometry::concept::PointDistanceStrategy<haversine_type>)
+ );
+
+
+ static void test(double lon1, double lat1, double lon2, double lat2,
+ double radius, double expected, double tolerance)
+ {
+ haversine_type strategy(radius);
+
+ Point p1, p2;
+ boost::geometry::assign(p1, lon1, lat1);
+ boost::geometry::assign(p2, lon2, lat2);
+ typename haversine_type::return_type d1 = strategy.apply(p1, p2);
+
+ BOOST_CHECK_CLOSE((double) d1, expected, tolerance);
+ }
+};
+
+template <typename Point>
+void test_all()
+{
+ double const average_earth_radius = 6372795.0;
+
+ // earth to unit-sphere -> divide by earth circumference, then it is from 0-1,
+ // then multiply with 2 PI, so effectively just divide by earth radius
+ double e2u = 1.0 / average_earth_radius;
+
+ // ~ Amsterdam/Paris
+ double const a_p = 467.2704 * 1000.0;
+ test_distance<Point>::test(4, 52, 2, 48, average_earth_radius, a_p, 1.0);
+ test_distance<Point>::test(2, 48, 4, 52, average_earth_radius, a_p, 1.0);
+ test_distance<Point>::test(4, 52, 2, 48, 1.0, a_p * e2u, 0.001);
+
+ // ~ Amsterdam/Barcelona
+ double const a_b = 1232.9065 * 1000.0;
+ test_distance<Point>::test(4, 52, 2, 41, average_earth_radius, a_b, 1.0);
+ test_distance<Point>::test(2, 41, 4, 52, average_earth_radius, a_b, 1.0);
+ test_distance<Point>::test(4, 52, 2, 41, 1.0, a_b * e2u, 0.001);
+}
+
+
+int test_main(int, char* [])
+{
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::spherical<boost::geometry::degree> > >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/haversine.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/haversine.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="haversine"
+ ProjectGUID="{AA654B76-E384-4E10-B367-4F51B5D3E96F}"
+ RootNamespace="haversine"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\haversine"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\haversine"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\haversine.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/strategies/projected_point.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/projected_point.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,99 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/strategies/cartesian/distance_projected_point.hpp>
+#include <boost/geometry/strategies/concepts/distance_concept.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename P1, typename P2>
+void test_all_2d()
+{
+ P1 p;
+ P2 sp1, sp2;
+ boost::geometry::read_wkt("POINT(1 1)", p);
+ boost::geometry::read_wkt("POINT(0 0)", sp1);
+ boost::geometry::read_wkt("POINT(2 3)", sp2);
+
+ typedef typename boost::geometry::strategy::distance::projected_point
+ <
+ P1,
+ P2
+ > strategy_type;
+
+ BOOST_CONCEPT_ASSERT
+ (
+ (boost::geometry::concept::PointSegmentDistanceStrategy<strategy_type>)
+ );
+
+
+ strategy_type strategy;
+ std::cout << strategy.apply(p, sp1, sp2) << std::endl;
+}
+
+
+template <typename P>
+void test_all_2d()
+{
+ using boost::geometry::point;
+ using boost::geometry::cs::cartesian;
+
+ //test_all_2d<P, int[2]>();
+ //test_all_2d<P, float[2]>();
+ //test_all_2d<P, double[2]>();
+ //test_all_2d<P, test::test_point>();
+ //test_all_2d<P, point<int, 2, cartesian> >();
+ //test_all_2d<P, point<float, 2, cartesian> >();
+ test_all_2d<P, point<double, 2, cartesian> >();
+}
+
+int test_main(int, char* [])
+{
+ using boost::geometry::point;
+ using boost::geometry::cs::cartesian;
+
+#if ! defined(_MSC_VER)
+ test_all_2d<int[2]>();
+ test_all_2d<float[2]>();
+ test_all_2d<double[2]>();
+#endif
+ //test_all_2d<test::test_point>();
+
+#if ! defined(_MSC_VER)
+ test_all_2d<point<int, 2, cartesian> >();
+#endif
+ test_all_2d<point<float, 2, cartesian> >();
+ test_all_2d<point<double, 2, cartesian> >();
+
+
+#if defined(HAVE_CLN)
+ // combination of CLN with normal types
+ typedef boost::numeric_adaptor::cln_value_type cln_type;
+ typedef point<cln_type, 2, cartesian> cln_point;
+ test_all_2d<cln_point>();
+
+#endif
+#if defined(HAVE_GMP)
+ typedef boost::numeric_adaptor::gmp_value_type gmp_type;
+ typedef point<gmp_type, 2, cartesian> gmp_point;
+ test_all_2d<gmp_point>();
+
+#endif
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/projected_point.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/projected_point.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="projected_point"
+ ProjectGUID="{A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}"
+ RootNamespace="projected_point"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projected_point"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\projected_point"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\projected_point.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/strategies/pythagoras.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/pythagoras.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,189 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+#include <boost/geometry/strategies/cartesian/distance_pythagoras.hpp>
+
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+template <typename P1, typename P2>
+void test_null_distance_3d()
+{
+ typename boost::geometry::strategy::distance::pythagoras<P1, P2> pythagoras;
+
+ P1 p1;
+ boost::geometry::assign(p1, 1, 2, 3);
+ P2 p2;
+ boost::geometry::assign(p2, 1, 2, 3);
+ BOOST_CHECK_EQUAL(double(
+ typename boost::geometry::coordinate_type<P1>::type(pythagoras.apply(p1, p2))), 0);
+}
+
+template <typename P1, typename P2>
+void test_axis_3d()
+{
+ boost::geometry::strategy::distance::pythagoras<P1, P2> pythagoras;
+
+ P1 p1;
+ boost::geometry::assign(p1, 0, 0, 0);
+
+ P2 p2;
+ boost::geometry::assign(p2, 1, 0, 0);
+ BOOST_CHECK_EQUAL(double(
+ typename boost::geometry::coordinate_type<P1>::type(pythagoras.apply(p1, p2))), 1);
+ boost::geometry::assign(p2, 0, 1, 0);
+ BOOST_CHECK_EQUAL(double(
+ typename boost::geometry::coordinate_type<P1>::type(pythagoras.apply(p1, p2))), 1);
+ boost::geometry::assign(p2, 0, 0, 1);
+ BOOST_CHECK_EQUAL(double(
+ typename boost::geometry::coordinate_type<P1>::type(pythagoras.apply(p1, p2))), 1);
+}
+
+template <typename P1, typename P2>
+void test_arbitrary_3d()
+{
+ boost::geometry::strategy::distance::pythagoras<P1, P2> pythagoras;
+
+ P1 p1;
+ boost::geometry::assign(p1, 1, 2, 3);
+ P2 p2;
+ boost::geometry::assign(p2, 9, 8, 7);
+ BOOST_CHECK_CLOSE(double(
+ typename boost::geometry::coordinate_type<P1>::type(pythagoras.apply(p1, p2))),
+ sqrt((double)116), 0.001);
+}
+
+template <typename CoordinateType, typename CalculationType, typename AssignType>
+void test_big_2d_with(AssignType const& x1, AssignType const& y1,
+ AssignType const& x2, AssignType const& y2)
+{
+ typedef boost::geometry::point<CoordinateType, 2, boost::geometry::cs::cartesian> point_type;
+ typedef boost::geometry::strategy::distance::pythagoras
+ <
+ point_type,
+ point_type,
+ CalculationType
+ > pythagoras_type;
+
+ pythagoras_type pythagoras;
+
+
+ point_type p1, p2;
+ boost::geometry::assign(p1, x1, y1);
+ boost::geometry::assign(p2, x2, y2);
+ typename pythagoras_type::return_type d1 = pythagoras.apply(p1, p2);
+
+ /*
+ std::cout << typeid(CalculationType).name()
+ << " " << std::fixed << std::setprecision(20) << d1.squared_value()
+ << std::endl << std::endl;
+ */
+
+ CalculationType d2 = d1;
+
+ BOOST_CHECK_CLOSE((double) d2,
+ 1076554.5485833955678294387789057, 0.001);
+}
+
+template <typename CoordinateType, typename CalculationType>
+void test_big_2d()
+{
+ test_big_2d_with<CoordinateType, CalculationType>
+ (123456.78900001, 234567.89100001,
+ 987654.32100001, 876543.21900001);
+}
+
+template <typename CoordinateType, typename CalculationType>
+void test_big_2d_string()
+{
+ test_big_2d_with<CoordinateType, CalculationType>
+ ("123456.78900001", "234567.89100001",
+ "987654.32100001", "876543.21900001");
+}
+
+
+
+template <typename P1, typename P2>
+void test_all_3d()
+{
+return;
+ test_null_distance_3d<P1, P2>();
+ test_axis_3d<P1, P2>();
+ test_arbitrary_3d<P1, P2>();
+}
+
+template <typename P>
+void test_all_3d()
+{
+ using boost::geometry::point;
+ using boost::geometry::cs::cartesian;
+
+ test_all_3d<P, int[3]>();
+ test_all_3d<P, float[3]>();
+ test_all_3d<P, double[3]>();
+ test_all_3d<P, test::test_point>();
+ test_all_3d<P, point<int, 3, cartesian> >();
+ test_all_3d<P, point<float, 3, cartesian> >();
+ test_all_3d<P, point<double, 3, cartesian> >();
+}
+
+int test_main(int, char* [])
+{
+ using boost::geometry::point;
+ using boost::geometry::cs::cartesian;
+
+#if ! defined(_MSC_VER)
+ test_all_3d<int[3]>();
+#endif
+ test_all_3d<float[3]>();
+ test_all_3d<double[3]>();
+ test_all_3d<test::test_point>();
+#if ! defined(_MSC_VER)
+ test_all_3d<point<int, 3, cartesian> >();
+#endif
+ test_all_3d<point<float, 3, cartesian> >();
+ test_all_3d<point<double, 3, cartesian> >();
+
+ test_big_2d<float, float>();
+ test_big_2d<double, double>();
+ test_big_2d<long double, long double>();
+ test_big_2d<float, long double>();
+
+/*
+TODO: fix this, assign type should use boost::to etc
+
+#if defined(HAVE_CLN)
+ // combination of CLN with normal types
+ typedef boost::numeric_adaptor::cln_value_type cln_type;
+ typedef point<cln_type, 3, cartesian> cln_point;
+ test_all_3d<cln_point>();
+ test_all_3d<cln_point, cln_point>();
+
+ test_big_2d<cln_type, cln_type>();
+ test_big_2d_string<cln_type, cln_type>();
+
+#endif
+#if defined(HAVE_GMP)
+ typedef boost::numeric_adaptor::gmp_value_type gmp_type;
+ typedef point<gmp_type, 3, cartesian> gmp_point;
+ test_all_3d<gmp_point>();
+ test_all_3d<gmp_point, gmp_point>();
+
+ test_big_2d<gmp_type, gmp_type>();
+ test_big_2d_string<gmp_type, gmp_type>();
+#endif
+*/
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/pythagoras.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/pythagoras.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="pythagoras"
+ ProjectGUID="{763CA955-FC01-4AFD-9593-69D36836B3F7}"
+ RootNamespace="pythagoras"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\pythagoras"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\pythagoras"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\pythagoras.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/strategies/segment_intersection.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/segment_intersection.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,367 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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)
+// We deliberately mix float/double's here so turn off warning
+#pragma warning( disable : 4244 )
+#endif // defined(_MSC_VER)
+
+#define HAVE_MATRIX_AS_STRING
+
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/strategies/cartesian/cart_intersect.hpp>
+#include <boost/geometry/strategies/intersection_result.hpp>
+
+#include <boost/geometry/policies/relate/intersection_points.hpp>
+#include <boost/geometry/policies/relate/direction.hpp>
+//#include <boost/geometry/policies/relate/de9im.hpp>
+#include <boost/geometry/policies/relate/tupled.hpp>
+
+#include <boost/geometry/algorithms/intersection.hpp>
+
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/segment.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+
+
+template <typename R>
+void print_is(R const& is)
+{
+#ifdef REPORT
+ for (int i = 0; i < is.count; i++)
+ {
+ std::cout
+ << " (" << boost::geometry::get<0>(is.intersections[i])
+ << "," << boost::geometry::get<1>(is.intersections[i])
+ << ")";
+ }
+#endif
+}
+/*
+void print_im(boost::geometry::de9im const& im)
+{
+#ifdef REPORT
+ if (im.equals()) std::cout << " EQUALS";
+ if (im.disjoint()) std::cout << " DISJOINT";
+ if (im.intersects()) std::cout << " INTERSECTS";
+ if (im.touches()) std::cout << " TOUCHES";
+ if (im.crosses()) std::cout << " CROSSES";
+ if (im.overlaps()) std::cout << " OVERLAPS";
+ if (im.within()) std::cout << " WITHIN";
+ if (im.contains()) std::cout << " CONTAINS";
+
+ //std::cout << " ra=" << im.ra << " rb=" << im.rb;
+#endif
+}
+*/
+
+template <typename P>
+static void test_segment_intersection(int caseno,
+ int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4,
+ std::string const& expected_matrix,
+ std::string const& expected_characteristic,
+ std::string const& expected_direction_a = "",
+ std::string const& expected_direction_b = "",
+ int expected_x1 = -99, int expected_y1 = -99,
+ int expected_x2 = -99, int expected_y2 = -99)
+{
+ using namespace boost::geometry;
+
+#ifdef REPORT
+ std::cout << "CASE " << caseno << std::endl;
+#endif
+
+ typedef typename boost::geometry::coordinate_type<P>::type coordinate_type;
+ typedef segment<const P> segment_type;
+
+ P p1, p2, p3, p4;
+ boost::geometry::assign(p1, x1, y1);
+ boost::geometry::assign(p2, x2, y2);
+ boost::geometry::assign(p3, x3, y3);
+ boost::geometry::assign(p4, x4, y4);
+
+ segment_type s12(p1,p2);
+ segment_type s34(p3,p4);
+
+ // Get the intersection point (or two points)
+ segment_intersection_points<P> is
+ = strategy::intersection::relate_cartesian_segments
+ <
+ policies::relate::segments_intersection_points
+ <
+ segment_type,
+ segment_type,
+ segment_intersection_points<P>
+ >
+ >::apply(s12, s34);
+
+ // Get the Dimension Extended 9 Intersection Matrix (de9im) for Segments
+ // (this one is extended by GGL having opposite)
+ /***
+ TODO TO BE UPDATED (if necessary) OR DELETED
+ de9im_segment matrix = strategy::intersection::relate_cartesian_segments
+ <
+ policies::relate::segments_de9im<segment_type, segment_type>
+ >::apply(s12, s34);
+ ***/
+
+ // Get just a character for Left/Right/intersects/etc, purpose is more for debugging
+ policies::relate::direction_type dir = strategy::intersection::relate_cartesian_segments
+ <
+ policies::relate::segments_direction<segment_type, segment_type>
+ >::apply(s12, s34);
+
+ int expected_count = 0;
+
+ if (expected_x1 != -99 && expected_y1 != -99)
+ {
+ expected_count++;
+
+ BOOST_CHECK(is.count >= 1);
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(is.intersections[0]),
+ coordinate_type(expected_x1), 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(is.intersections[0]),
+ coordinate_type(expected_y1), 0.001);
+ }
+ if (expected_x2 != -99 && expected_y2 != -99)
+ {
+ expected_count++;
+
+ BOOST_CHECK(is.count >= 2);
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(is.intersections[1]),
+ coordinate_type(expected_x2), 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(is.intersections[1]),
+ coordinate_type(expected_y2), 0.001);
+ }
+ BOOST_CHECK_EQUAL(is.count, expected_count);
+
+ //BOOST_CHECK_EQUAL(expected_matrix, matrix.matrix_as_string());
+
+ std::string characteristic;
+ characteristic += dir.how;
+
+ BOOST_CHECK_EQUAL(characteristic, expected_characteristic);
+
+ if (!expected_direction_a.empty())
+ {
+ BOOST_CHECK_EQUAL(dir.dir_a == 1 ? "L"
+ : dir.dir_a == -1 ? "R"
+ : "-", expected_direction_a);
+ }
+ if (!expected_direction_b.empty())
+ {
+ BOOST_CHECK_EQUAL(dir.dir_b == 1 ? "L"
+ : dir.dir_b == -1 ? "R"
+ : "-", expected_direction_b);
+ }
+
+
+
+ // Things can also be used together
+ // -> intersection is only once calculated, two results
+ /***
+ typedef boost::tuple
+ <
+ de9im_segment,
+ policies::relate::direction_type
+ > tup;
+
+ tup t = strategy::intersection::relate_cartesian_segments
+ <
+ policies::relate::segments_tupled
+ <
+ policies::relate::segments_de9im<segment_type, segment_type>,
+ policies::relate::segments_direction<segment_type, segment_type>
+ >
+ >::apply(segment_type(p1,p2), segment_type(p3,p4));
+
+
+ //BOOST_CHECK_EQUAL(t.get<0>().matrix_as_string(), matrix.matrix_as_string());
+ BOOST_CHECK_EQUAL(t.get<1>().how, dir.how);
+ */
+
+#ifdef REPORT
+ //std::cout << std::endl << "\t" << matrix.as_string() << " ";
+ std::cout << "METHOD=" << c << " ";
+ print_is(is);
+ //print_im(matrix);
+ std::cout << std::endl;
+#endif
+
+ /*
+ To check with a spatial database: issue this statement
+ std::cout << "select relate("
+ << "GeomFromText(LINESTRING('" << x1 << " " << y1 << "," << x2 << " " << y2 << ")')"
+ << ", "
+ << "GeomFromText(LINESTRING('" << x3 << " " << y3 << "," << x4 << " " << y4 << ")')"
+ << ");"
+ << std::endl;
+ */
+
+
+ // Now use generic intersection.
+ std::vector<P> out;
+ boost::geometry::intersection_inserter<P>(s12, s34, std::back_inserter(out));
+
+ BOOST_CHECK_EQUAL(boost::size(out), expected_count);
+
+ if (expected_x1 != -99 && expected_y1 != -99
+ && is.count >= 1
+ && boost::size(out) >= 1)
+ {
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(out[0]),
+ coordinate_type(expected_x1), 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(out[0]),
+ coordinate_type(expected_y1), 0.001);
+ }
+ if (expected_x2 != -99 && expected_y2 != -99
+ && is.count >= 2
+ && boost::size(out) >= 2)
+ {
+ BOOST_CHECK_CLOSE(boost::geometry::get<0>(out[1]),
+ coordinate_type(expected_x2), 0.001);
+ BOOST_CHECK_CLOSE(boost::geometry::get<1>(out[1]),
+ coordinate_type(expected_y2), 0.001);
+ }
+}
+
+
+template <typename P>
+void test_all()
+{
+ test_segment_intersection<P>( 1, 0,2, 2,0, 0,0, 2,2, "0-1--0102",
+ "i", "R", "L", 1, 1);
+ test_segment_intersection<P>( 2, 2,2, 3,1, 0,0, 2,2, "--1-00102",
+ "a", "R", "R", 2, 2);
+ test_segment_intersection<P>( 3, 3,1, 2,2, 0,0, 2,2, "--1-00102",
+ "t", "R", "L", 2, 2);
+ test_segment_intersection<P>( 4, 0,2, 1,1, 0,0, 2,2, "--10-0102",
+ "m", "L", "L", 1, 1);
+#ifdef REPORT
+ std::cout << std::endl;
+#endif
+
+ test_segment_intersection<P>( 5, 1,1, 0,2, 0,0, 2,2, "--10-0102",
+ "s", "L", "R", 1, 1);
+ test_segment_intersection<P>( 6, 0,2, 2,0, 0,0, 1,1, "-01--0102",
+ "m", "R", "R", 1, 1);
+ test_segment_intersection<P>( 7, 2,0, 0,2, 0,0, 1,1, "-01--0102",
+ "m", "L", "L", 1, 1);
+ test_segment_intersection<P>( 8, 2,3, 3,2, 0,0, 2,2, "--1--0102",
+ "d");
+#ifdef REPORT
+ std::cout << std::endl;
+#endif
+
+ test_segment_intersection<P>( 9, 0,0, 2,2, 0,0, 2,2, "1---0---2",
+ "e", "-", "-", 0, 0, 2, 2);
+ test_segment_intersection<P>(10, 2,2, 0,0, 0,0, 2,2, "1---0---2",
+ "e", "-", "-", 2, 2, 0, 0);
+ test_segment_intersection<P>(11, 1,1, 3,3, 0,0, 2,2, "1010-0102",
+ "c", "-", "-", 1, 1, 2, 2);
+ test_segment_intersection<P>(12, 3,3, 1,1, 0,0, 2,2, "1010-0102",
+ "c", "-", "-", 1, 1, 2, 2);
+#ifdef REPORT
+ std::cout << std::endl;
+#endif
+
+ test_segment_intersection<P>(13, 0,2, 2,2, 2,1, 2,3, "--10-0102",
+ "m", "L", "L", 2, 2);
+ test_segment_intersection<P>(14, 2,2, 2,4, 2,0, 2,2, "--1-00102",
+ "C", "-", "-", 2, 2);
+ test_segment_intersection<P>(15, 2,2, 2,4, 2,0, 2,1, "--1--0102",
+ "d");
+ test_segment_intersection<P>(16, 2,4, 2,2, 2,0, 2,1, "--1--0102",
+ "d");
+
+ test_segment_intersection<P>(17, 2,1, 2,3, 2,2, 2,4, "1010-0102",
+ "c", "-", "-", 2, 3, 2, 2);
+ test_segment_intersection<P>(18, 2,3, 2,1, 2,2, 2,4, "1010-0102",
+ "c", "-", "-", 2, 3, 2, 2);
+ test_segment_intersection<P>(19, 0,2, 2,2, 4,2, 2,2, "--1-00102",
+ "C", "-", "-", 2, 2);
+ test_segment_intersection<P>(20, 0,2, 2,2, 2,2, 4,2, "--1-00102",
+ "C", "-", "-", 2, 2);
+
+ test_segment_intersection<P>(21, 1,2, 3,2, 2,1, 2,3, "0-1--0102",
+ "i", "R", "L", 2, 2);
+ test_segment_intersection<P>(22, 2,4, 2,1, 2,1, 2,3, "101-00--2",
+ "c", "-", "-", 2, 1, 2, 3);
+ test_segment_intersection<P>(23, 2,4, 2,1, 2,3, 2,1, "101-00--2",
+ "c", "-", "-", 2, 3, 2, 1);
+ test_segment_intersection<P>(24, 1,1, 3,3, 0,0, 3,3, "1--00-102",
+ "c", "-", "-", 1, 1, 3, 3);
+
+ test_segment_intersection<P>(25, 2,0, 2,4, 2,1, 2,3, "101--0--2",
+ "c", "-", "-", 2, 1, 2, 3);
+ test_segment_intersection<P>(26, 2,0, 2,4, 2,3, 2,1, "101--0--2",
+ "c", "-", "-", 2, 3, 2, 1);
+ test_segment_intersection<P>(27, 0,0, 4,4, 1,1, 3,3, "101--0--2",
+ "c", "-", "-", 1, 1, 3, 3);
+ test_segment_intersection<P>(28, 0,0, 4,4, 3,3, 1,1, "101--0--2",
+ "c", "-", "-", 3, 3, 1, 1);
+
+ test_segment_intersection<P>(29, 1,1, 3,3, 0,0, 4,4, "1--0--102",
+ "c", "-", "-", 1, 1, 3, 3);
+ test_segment_intersection<P>(30, 0,0, 2,2, 2,2, 3,1, "--1-00102",
+ "a", "R", "R", 2, 2);
+ test_segment_intersection<P>(31, 0,0, 2,2, 2,2, 1,3, "--1-00102",
+ "a", "L", "L", 2, 2);
+ test_segment_intersection<P>(32, 0,0, 2,2, 1,1, 2,0, "-01--0102",
+ "s", "L", "R", 1, 1);
+
+ test_segment_intersection<P>(33, 0,0, 2,2, 1,1, 0,2, "-01--0102",
+ "s", "R", "L", 1, 1);
+ test_segment_intersection<P>(34, 2,2, 1,3, 0,0, 2,2, "--1-00102",
+ "a", "L", "L", 2, 2);
+ test_segment_intersection<P>(35, 2,2, 3,1, 0,0, 2,2, "--1-00102",
+ "a", "R", "R", 2, 2);
+ test_segment_intersection<P>(36, 0,0, 2,2, 0,2, 1,1, "-01--0102",
+ "m", "L", "L", 1, 1);
+
+ test_segment_intersection<P>(37, 0,0, 2,2, 2,0, 1,1, "-01--0102",
+ "m", "R", "R", 1, 1);
+ test_segment_intersection<P>(38, 1,1, 0,2, 0,0, 2,2, "--10-0102",
+ "s", "L", "R", 1, 1);
+ test_segment_intersection<P>(39, 1,1, 2,0, 0,0, 2,2, "--10-0102",
+ "s", "R", "L", 1, 1);
+ test_segment_intersection<P>(40, 2,0, 1,1, 0,0, 2,2, "--10-0102",
+ "m", "R", "R", 1, 1);
+
+ test_segment_intersection<P>(41, 1,2, 0,2, 2,2, 0,2, "1--00-102",
+ "c", "-", "-", 1, 2, 0, 2);
+ test_segment_intersection<P>(42, 2,1, 1,1, 2,2, 0,2, "--1--0102",
+ "p");
+ test_segment_intersection<P>(43, 4,1, 3,1, 2,2, 0,2, "--1--0102",
+ "p");
+ test_segment_intersection<P>(44, 4,2, 3,2, 2,2, 0,2, "--1--0102",
+ "d");
+
+ test_segment_intersection<P>(45, 2,0, 0,2, 0,0, 2,2, "0-1--0102",
+ "i", "L", "R", 1, 1);
+
+ // In figure: times 2
+ test_segment_intersection<P>(46, 8,2, 4,6, 0,0, 8, 8, "0-1--0102",
+ "i", "L", "R", 5, 5);
+}
+
+int test_main(int, char* [])
+{
+ std::cout << "Note this test is out-of-date and either obsolete or should be updated" << std::endl;
+ test_all<boost::tuple<double, double> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/segment_intersection.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/segment_intersection.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="segment_intersection"
+ ProjectGUID="{4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}"
+ RootNamespace="segment_intersection"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment_intersection"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment_intersection"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\segment_intersection.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/strategies/segment_intersection_collinear.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/segment_intersection_collinear.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,249 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/strategies/cartesian/cart_intersect.hpp>
+#include <boost/geometry/strategies/intersection_result.hpp>
+
+#include <boost/geometry/policies/relate/intersection_points.hpp>
+#include <boost/geometry/policies/relate/direction.hpp>
+#include <boost/geometry/policies/relate/de9im.hpp>
+#include <boost/geometry/policies/relate/tupled.hpp>
+
+#include <boost/geometry/algorithms/intersection.hpp>
+
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/segment.hpp>
+
+template <typename IntersectionPoints>
+static int check(IntersectionPoints const& is,
+ std::size_t index, double expected_x, double expected_y)
+{
+ namespace bg = boost::geometry;
+ if (expected_x != -99 && expected_y != -99 && is.count > index)
+ {
+ double x = bg::get<0>(is.intersections[index]);
+ double y = bg::get<1>(is.intersections[index]);
+
+ BOOST_CHECK_CLOSE(x, expected_x, 0.001);
+ BOOST_CHECK_CLOSE(y, expected_y, 0.001);
+ return 1;
+ }
+ return 0;
+}
+
+
+template <typename P>
+static void test_segment_intersection(std::string const& case_id,
+ int x1, int y1, int x2, int y2,
+ int x3, int y3, int x4, int y4,
+ char expected_how, bool expected_opposite,
+ int expected_arrival1, int expected_arrival2,
+ int expected_x1, int expected_y1,
+ int expected_x2 = -99, int expected_y2 = -99)
+
+{
+ namespace bg = boost::geometry;
+
+//#ifdef REPORT
+ std::cout << "Case: " << case_id << std::endl;
+//#endif
+
+ typedef typename bg::coordinate_type<P>::type coordinate_type;
+ typedef bg::segment<const P> segment_type;
+
+ P p1, p2, p3, p4;
+ bg::assign(p1, x1, y1);
+ bg::assign(p2, x2, y2);
+ bg::assign(p3, x3, y3);
+ bg::assign(p4, x4, y4);
+
+ segment_type s12(p1,p2);
+ segment_type s34(p3,p4);
+
+ // Get the intersection point (or two points)
+ bg::segment_intersection_points<P> is
+ = bg::strategy::intersection::relate_cartesian_segments
+ <
+ bg::policies::relate::segments_intersection_points
+ <
+ segment_type,
+ segment_type,
+ bg::segment_intersection_points<P>
+ >
+ >::apply(s12, s34);
+
+ // Get just a character for Left/Right/intersects/etc, purpose is more for debugging
+ bg::policies::relate::direction_type dir
+ = bg::strategy::intersection::relate_cartesian_segments
+ <
+ bg::policies::relate::segments_direction
+ <
+ segment_type,
+ segment_type
+ >
+ >::apply(s12, s34);
+
+ int expected_count =
+ check(is, 0, expected_x1, expected_y1)
+ + check(is, 1, expected_x2, expected_y2);
+
+ BOOST_CHECK_EQUAL(is.count, expected_count);
+ BOOST_CHECK_EQUAL(dir.how, expected_how);
+ BOOST_CHECK_EQUAL(dir.opposite, expected_opposite);
+ BOOST_CHECK_EQUAL(dir.arrival[0], expected_arrival1);
+ BOOST_CHECK_EQUAL(dir.arrival[1], expected_arrival2);
+}
+
+
+template <typename P>
+void test_all()
+{
+ // Collinear - non opposite
+
+ // a1---------->a2
+ // b1--->b2
+ test_segment_intersection<P>("n1",
+ 2, 0, 6, 0,
+ 0, 0, 2, 0,
+ 'a', false, -1, 0,
+ 2, 0);
+
+ // a1---------->a2
+ // b1--->b2
+ test_segment_intersection<P>("n2",
+ 2, 0, 6, 0,
+ 1, 0, 3, 0,
+ 'c', false, -1, 1,
+ 2, 0, 3, 0);
+
+ // a1---------->a2
+ // b1--->b2
+ test_segment_intersection<P>("n3",
+ 2, 0, 6, 0,
+ 2, 0, 4, 0,
+ 'c', false, -1, 1,
+ 2, 0, 4, 0);
+
+ // a1---------->a2
+ // b1--->b2
+ test_segment_intersection<P>("n4",
+ 2, 0, 6, 0,
+ 3, 0, 5, 0,
+ 'c', false, -1, 1,
+ 3, 0, 5, 0);
+
+ // a1---------->a2
+ // b1--->b2
+ test_segment_intersection<P>("n5",
+ 2, 0, 6, 0,
+ 4, 0, 6, 0,
+ 'c', false, 0, 0,
+ 4, 0, 6, 0);
+
+ // a1---------->a2
+ // b1--->b2
+ test_segment_intersection<P>("n6",
+ 2, 0, 6, 0,
+ 5, 0, 7, 0,
+ 'c', false, 1, -1,
+ 5, 0, 6, 0);
+
+ // a1---------->a2
+ // b1--->b2
+ test_segment_intersection<P>("n7",
+ 2, 0, 6, 0,
+ 6, 0, 8, 0,
+ 'a', false, 0, -1,
+ 6, 0);
+
+ // Collinear - opposite
+ // a1---------->a2
+ // b2<---b1
+ test_segment_intersection<P>("o1",
+ 2, 0, 6, 0,
+ 2, 0, 0, 0,
+ 'f', true, -1, -1,
+ 2, 0);
+
+ // a1---------->a2
+ // b2<---b1
+ test_segment_intersection<P>("o2",
+ 2, 0, 6, 0,
+ 3, 0, 1, 0,
+ 'c', true, -1, -1,
+ 2, 0, 3, 0);
+
+ // a1---------->a2
+ // b2<---b1
+ test_segment_intersection<P>("o3",
+ 2, 0, 6, 0,
+ 4, 0, 2, 0,
+ 'c', true, -1, 0,
+ 2, 0, 4, 0);
+
+ // a1---------->a2
+ // b2<---b1
+ test_segment_intersection<P>("o4",
+ 2, 0, 6, 0,
+ 5, 0, 3, 0,
+ 'c', true, -1, 1,
+ 3, 0, 5, 0);
+
+ // a1---------->a2
+ // b2<---b1
+ test_segment_intersection<P>("o5",
+ 2, 0, 6, 0,
+ 6, 0, 4, 0,
+ 'c', true, 0, 1,
+ 4, 0, 6, 0);
+
+ // a1---------->a2
+ // b2<---b1
+ test_segment_intersection<P>("o6",
+ 2, 0, 6, 0,
+ 7, 0, 5, 0,
+ 'c', true, 1, 1,
+ 5, 0, 6, 0);
+
+ // a1---------->a2
+ // b2<---b1
+ test_segment_intersection<P>("o7",
+ 2, 0, 6, 0,
+ 8, 0, 6, 0,
+ 't', true, 0, 0,
+ 6, 0);
+
+ // a1---------->a2
+ // b1---------->b2
+ test_segment_intersection<P>("e1",
+ 2, 0, 6, 0,
+ 2, 0, 6, 0,
+ 'e', false, 0, 0,
+ 2, 0, 6, 0);
+
+ // a1---------->a2
+ // b2<----------b1
+ test_segment_intersection<P>("e1",
+ 2, 0, 6, 0,
+ 6, 0, 2, 0,
+ 'e', true, 0, 0,
+ 2, 0, 6, 0);
+}
+
+int test_main(int, char* [])
+{
+ namespace bg = boost::geometry;
+ test_all<bg::point<double, 2, bg::cs::cartesian> >();
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/segment_intersection_collinear.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/segment_intersection_collinear.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="segment_intersection_collinear"
+ ProjectGUID="{2D0CB6D3-6ABC-4119-A235-66E6065A279E}"
+ RootNamespace="segment_intersection_collinear"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment_intersection_collinear"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\segment_intersection_collinear"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\segment_intersection_collinear.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/strategies/side_by_cross_track.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/side_by_cross_track.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,54 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/strategies/spherical/side_by_cross_track.hpp>
+
+#include <boost/geometry/core/cs.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/segment.hpp>
+
+
+template <typename Point>
+void test_side(double lon1, double lat1,
+ double lon2, double lat2,
+ double lon3, double lat3,
+ int expected)
+{
+ namespace bg = boost::geometry;
+ typedef bg::strategy::side::side_by_cross_track<double> strategy;
+
+ Point p1, p2, p3;
+ boost::geometry::assign(p1, lon1, lat1);
+ boost::geometry::assign(p2, lon2, lat2);
+ boost::geometry::assign(p3, lon3, lat3);
+ int s = strategy::apply(p1, p2, p3);
+
+}
+
+template <typename Point>
+void test_all()
+{
+ test_side<Point>(2.0, 48.0, 4.0, 52.0, 2.0, 41.0, 1);
+ test_side<Point>(2.0, 48.0, 2.0, 41.0, 4.0, 52.0, -1);
+}
+
+int test_main(int, char* [])
+{
+ namespace bg = boost::geometry;
+ test_all<bg::point<double, 2, bg::cs::spherical<bg::degree> > >();
+
+ double a = 0;
+ double b = sin(a);
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/side_by_cross_track.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/side_by_cross_track.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="side_by_cross_track"
+ ProjectGUID="{ADBE38D8-1828-48A2-BBA1-81F50B53C67C}"
+ RootNamespace="side_by_cross_track"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\side_by_cross_track"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\side_by_cross_track"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\side_by_cross_track.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/strategies/strategies_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/strategies_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,61 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythagoras", "pythagoras.vcproj", "{763CA955-FC01-4AFD-9593-69D36836B3F7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transformer", "transformer.vcproj", "{9B62EBF7-D444-4D67-BA00-48CAEAF92756}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment_intersection", "segment_intersection.vcproj", "{4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "haversine", "haversine.vcproj", "{AA654B76-E384-4E10-B367-4F51B5D3E96F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cross_track", "cross_track.vcproj", "{4CE6F112-9EA1-4D7E-9AC6-907E77895263}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projected_point", "projected_point.vcproj", "{A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment_intersection_collinear", "segment_intersection_collinear.vcproj", "{2D0CB6D3-6ABC-4119-A235-66E6065A279E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "side_by_cross_track", "side_by_cross_track.vcproj", "{ADBE38D8-1828-48A2-BBA1-81F50B53C67C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Debug|Win32.Build.0 = Debug|Win32
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Release|Win32.ActiveCfg = Release|Win32
+ {763CA955-FC01-4AFD-9593-69D36836B3F7}.Release|Win32.Build.0 = Release|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Debug|Win32.Build.0 = Debug|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Release|Win32.ActiveCfg = Release|Win32
+ {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Release|Win32.Build.0 = Release|Win32
+ {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Debug|Win32.Build.0 = Debug|Win32
+ {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Release|Win32.ActiveCfg = Release|Win32
+ {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Release|Win32.Build.0 = Release|Win32
+ {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Debug|Win32.ActiveCfg = Debug|Win32
+ {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Debug|Win32.Build.0 = Debug|Win32
+ {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Release|Win32.ActiveCfg = Release|Win32
+ {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Release|Win32.Build.0 = Release|Win32
+ {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Debug|Win32.Build.0 = Debug|Win32
+ {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Release|Win32.ActiveCfg = Release|Win32
+ {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Release|Win32.Build.0 = Release|Win32
+ {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Debug|Win32.Build.0 = Debug|Win32
+ {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Release|Win32.ActiveCfg = Release|Win32
+ {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Release|Win32.Build.0 = Release|Win32
+ {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Debug|Win32.Build.0 = Debug|Win32
+ {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Release|Win32.ActiveCfg = Release|Win32
+ {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Release|Win32.Build.0 = Release|Win32
+ {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Debug|Win32.Build.0 = Debug|Win32
+ {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Release|Win32.ActiveCfg = Release|Win32
+ {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/strategies/transformer.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/transformer.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,106 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/strategies/transform/inverse_transformer.hpp>
+#include <boost/geometry/strategies/transform/map_transformer.hpp>
+#include <boost/geometry/strategies/transform/matrix_transformers.hpp>
+
+
+#include <boost/geometry/algorithms/make.hpp>
+#include <boost/geometry/algorithms/transform.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+
+
+
+template <typename P, typename T>
+void check_inverse(P const& p, T const& trans)
+{
+ boost::geometry::strategy::transform::inverse_transformer<P, P> inverse(trans);
+
+ P i;
+ boost::geometry::transform(p, i, inverse);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(i)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(i)), 1.0, 0.001);
+}
+
+template <typename P>
+void test_all()
+{
+ P p;
+ boost::geometry::assign(p, 1, 1);
+
+ {
+ boost::geometry::strategy::transform::translate_transformer<P, P> trans(1, 1);
+ P tp;
+ boost::geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 2.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), 2.0, 0.001);
+
+ check_inverse(tp, trans);
+ }
+
+ {
+ boost::geometry::strategy::transform::scale_transformer<P, P> trans(10, 10);
+ P tp;
+ boost::geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 10.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), 10.0, 0.001);
+
+ check_inverse(tp, trans);
+ }
+
+ {
+ boost::geometry::strategy::transform::rotate_transformer<P, P, boost::geometry::degree> trans(90.0);
+ P tp;
+ boost::geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 1.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), -1.0, 0.001);
+ check_inverse(tp, trans);
+ }
+
+ {
+ // Map from 0,0,2,2 to 0,0,500,500
+ boost::geometry::strategy::transform::map_transformer<P, P, false> trans
+ (
+ 0.0, 0.0, 2.0, 2.0, 500, 500
+ );
+ P tp;
+ boost::geometry::transform(p, tp, trans);
+
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<0>(tp)), 250.0, 0.001);
+ BOOST_CHECK_CLOSE(double(boost::geometry::get<1>(tp)), 250.0, 0.001);
+
+ check_inverse(tp, trans);
+ }
+}
+
+int test_main(int, char* [])
+{
+ //test_all<int[2]>();
+ test_all<float[2]>();
+ test_all<double[2]>();
+
+ test_all<boost::tuple<float, float> >();
+
+ //test_all<point<int, 2, cs::cartesian> >();
+ test_all<boost::geometry::point<float, 2, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/strategies/transformer.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/strategies/transformer.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="transformer"
+ ProjectGUID="{9B62EBF7-D444-4D67-BA00-48CAEAF92756}"
+ RootNamespace="transformer"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transformer"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\transformer"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\transformer.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/test_common/test_point.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/test_common/test_point.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,90 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 GGL_TEST_TEST_COMMON_TEST_POINT_HPP
+#define GGL_TEST_TEST_COMMON_TEST_POINT_HPP
+
+#include <boost/geometry/core/access.hpp>
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/core/coordinate_system.hpp>
+#include <boost/geometry/core/coordinate_dimension.hpp>
+#include <boost/geometry/core/cs.hpp>
+#include <boost/geometry/core/tag.hpp>
+
+
+namespace test
+{
+
+// Test point class
+
+struct test_point
+{
+ float c1, c2, c3;
+};
+
+
+} // namespace test
+
+
+namespace boost { namespace geometry { namespace traits {
+
+template<>
+struct tag<test::test_point> { typedef point_tag type; };
+
+template<>
+struct coordinate_type<test::test_point> { typedef float type; };
+
+template<>
+struct coordinate_system<test::test_point> { typedef cs::cartesian type; };
+
+template<>
+struct dimension<test::test_point>: boost::mpl::int_<3> {};
+
+template<> struct access<test::test_point, 0>
+{
+ static inline const float& get(const test::test_point& p)
+ {
+ return p.c1;
+ }
+
+ static inline void set(test::test_point& p, const float& value)
+ {
+ p.c1 = value;
+ }
+};
+
+template<> struct access<test::test_point, 1>
+{
+ static inline const float& get(const test::test_point& p)
+ {
+ return p.c2;
+ }
+
+ static inline void set(test::test_point& p, const float& value)
+ {
+ p.c2 = value;
+ }
+};
+
+template<> struct access<test::test_point, 2>
+{
+ static inline const float& get(const test::test_point& p)
+ {
+ return p.c3;
+ }
+
+ static inline void set(test::test_point& p, const float& value)
+ {
+ p.c3 = value;
+ }
+};
+
+}}} // namespace boost::geometry::traits
+
+#endif // GGL_TEST_TEST_COMMON_TEST_POINT_HPP

Added: sandbox/geometry/libs/geometry/test/test_common/with_pointer.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/test_common/with_pointer.hpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,81 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 GGL_TEST_COMMON_WITH_POINTER_HPP
+#define GGL_TEST_COMMON_WITH_POINTER_HPP
+
+
+#include <boost/geometry/core/access.hpp>
+#include <boost/geometry/core/coordinate_type.hpp>
+#include <boost/geometry/core/coordinate_system.hpp>
+#include <boost/geometry/core/coordinate_dimension.hpp>
+#include <boost/geometry/core/cs.hpp>
+#include <boost/geometry/core/tag.hpp>
+
+
+namespace test
+{
+
+// Sample point, having x/y
+struct test_point_xy
+{
+ float x,y;
+};
+
+}
+
+
+namespace boost { namespace geometry { namespace traits {
+
+template<> struct tag<test::test_point_xy*>
+{ typedef point_tag type; };
+
+template<> struct coordinate_type<test::test_point_xy*>
+{ typedef double type; };
+
+template<> struct coordinate_system<test::test_point_xy*>
+{ typedef cs::cartesian type; };
+
+template<> struct dimension<test::test_point_xy*> : boost::mpl::int_<2> {};
+
+template<>
+struct access<test::test_point_xy*, 0>
+{
+ static double get(test::test_point_xy const* p)
+ {
+ return p->x;
+ }
+
+ static void set(test::test_point_xy* p, double const& value)
+ {
+ p->x = value;
+ }
+
+};
+
+
+template<>
+struct access<test::test_point_xy*, 1>
+{
+ static double get(test::test_point_xy const* p)
+ {
+ return p->y;
+ }
+
+ static void set(test::test_point_xy* p, double const& value)
+ {
+ p->y = value;
+ }
+
+};
+
+}}} // namespace boost::geometry::traits
+
+
+#endif // #ifndef GGL_TEST_COMMON_WITH_POINTER_HPP

Added: sandbox/geometry/libs/geometry/test/util/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/Jamfile.v2 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,16 @@
+# test/util/Jamfile.v2
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz_at_[hidden]>
+#
+# Use, modification and distribution is subject to the 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 ggl-util
+ :
+ [ run copy.cpp ]
+ [ run for_each_coordinate.cpp ]
+ [ run loop.cpp ]
+ [ run select_most_precise.cpp ]
+ [ run write_dsv.cpp ]
+ ;

Added: sandbox/geometry/libs/geometry/test/util/as_range.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/as_range.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,73 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/iterators/range_type.hpp>
+#include <boost/geometry/util/as_range.hpp>
+
+#include <boost/geometry/core/cs.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+template <int D, typename Range>
+double sum(Range const& range)
+{
+ double s = 0.0;
+ for (typename boost::range_const_iterator<Range>::type it = boost::begin(range);
+ it != boost::end(range); ++it)
+ {
+ s += boost::geometry::get<D>(*it);
+ }
+ return s;
+}
+
+template <typename G>
+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 boost::geometry::range_type<G>::type range_type;
+
+ boost::geometry::read_wkt(wkt, geometry);
+
+ double s = sum<0>(boost::geometry::as_range<range_type>(geometry));
+ BOOST_CHECK_CLOSE(s, expected_x, 0.001);
+
+ s = sum<1>(boost::geometry::as_range<range_type>(geometry));
+ BOOST_CHECK_CLOSE(s, expected_y, 0.001);
+}
+
+
+template <typename P>
+void test_all()
+{
+ // As-range utility should consider a geometry as a range, so
+ // linestring stays linestring
+ test_geometry<boost::geometry::linestring<P> >("LINESTRING(1 2,3 4)", 4, 6);
+
+ // polygon will only be outer-ring
+ test_geometry<boost::geometry::polygon<P> >("POLYGON((1 2,3 4))", 4, 6);
+ test_geometry<boost::geometry::polygon<P> >("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<boost::geometry::point<double, 2, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/util/as_range.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/as_range.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="as_range"
+ ProjectGUID="{A36D8426-67EB-405C-B6E8-3FBB3374A59B}"
+ RootNamespace="as_range"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\as_range"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\as_range"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\as_range.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/util/copy.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/copy.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,44 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/util/copy.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+
+template <typename P>
+void test_all()
+{
+ P p1;
+ boost::geometry::assign(p1, 1, 22, 333);
+ P p2;
+ boost::geometry::copy_coordinates(p1, p2);
+ BOOST_CHECK(boost::geometry::get<0>(p2) == 1);
+ BOOST_CHECK(boost::geometry::get<1>(p2) == 22);
+ BOOST_CHECK(boost::geometry::get<2>(p2) == 333);
+}
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test::test_point>();
+ test_all<boost::geometry::point<int, 3, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<float, 3, boost::geometry::cs::cartesian> >();
+ test_all<boost::geometry::point<double, 3, boost::geometry::cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/util/copy.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/copy.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="copy"
+ ProjectGUID="{58B7C340-54BC-4B74-BA10-C289E14B2FFB}"
+ RootNamespace="copy"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\copy"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\copy"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\copy.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/util/for_each_coordinate.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/for_each_coordinate.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,56 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+
+#include <boost/geometry/util/for_each_coordinate.hpp>
+
+#include <boost/geometry/algorithms/assign.hpp>
+
+
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <test_common/test_point.hpp>
+
+using namespace boost::geometry;
+
+struct test_operation
+{
+ template <typename P, int I>
+ static void apply(P& p)
+ {
+ set<I>(p, get<I>(p) * 10);
+ }
+};
+
+template <typename P>
+void test_all()
+{
+ P p;
+ boost::geometry::assign(p, 1, 2, 3);
+ boost::geometry::for_each_coordinate(p, test_operation());
+ BOOST_CHECK(get<0>(p) == 10);
+ BOOST_CHECK(get<1>(p) == 20);
+ BOOST_CHECK(get<2>(p) == 30);
+}
+
+int test_main(int, char* [])
+{
+ test_all<int[3]>();
+ test_all<float[3]>();
+ test_all<double[3]>();
+ test_all<test::test_point>();
+ test_all<point<int, 3, cs::cartesian> >();
+ test_all<point<float, 3, cs::cartesian> >();
+ test_all<point<double, 3, cs::cartesian> >();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/util/for_each_coordinate.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/for_each_coordinate.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="for_each_coordinate"
+ ProjectGUID="{900CD32E-1B78-40E3-887F-9BCCC0A1041E}"
+ RootNamespace="for_each_coordinate"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\for_each_coordinate"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\for_each_coordinate"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\for_each_coordinate.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/util/select_most_precise.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/select_most_precise.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,82 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008, 2009
+// Use, modification and distribution is subject to the 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 <ggl_test_common.hpp>
+
+#include <boost/geometry/util/select_most_precise.hpp>
+
+
+#include <boost/mpl/int.hpp>
+
+
+using namespace boost::geometry;
+
+struct user_defined
+{
+};
+
+template <typename T> struct check_selection : public boost::mpl::int_<0> {};
+
+template <> struct check_selection<short int> : public boost::mpl::int_<1> {};
+template <> struct check_selection<int> : public boost::mpl::int_<2> {};
+template <> struct check_selection<float> : public boost::mpl::int_<11> {};
+template <> struct check_selection<double> : public boost::mpl::int_<12> {};
+template <> struct check_selection<long double> : public boost::mpl::int_<13> {};
+template <> struct check_selection<user_defined> : public boost::mpl::int_<99> {};
+
+template <> struct check_selection<void> : public boost::mpl::int_<98> {};
+
+
+template <typename T1, typename T2, typename TypeToBeSelected>
+void test()
+{
+ typedef typename boost::geometry::select_most_precise<T1, T2>::type type;
+ BOOST_CHECK_EQUAL(check_selection<type>::type::value,
+ check_selection<TypeToBeSelected>::type::value);
+}
+
+int test_main(int, char* [])
+{
+ // fp only
+ test<float, float, float>();
+ test<float, double, double>();
+ test<double, float, double>();
+ test<double, double, double>();
+
+ // integer only
+ test<int, int, int>();
+ test<int, short int, int>();
+ test<short int, int, int>();
+ test<short int, short int, short int>();
+
+ // int/fp
+ test<double, int, double>();
+ test<int, double, double>();
+ test<long double, long double, long double>();
+ test<float, int, float>();
+ test<int, float, float>();
+
+#ifndef _MSC_VER
+ // This cannot be done for MSVC because double/long double is the same
+ test<double, long double, long double>();
+ test<long double, double, long double>();
+#endif
+
+ // with any other non-integer/float class
+ test<int, user_defined, user_defined>();
+ test<user_defined, int, user_defined>();
+ test<long double, user_defined, user_defined>();
+ test<user_defined, long double, user_defined>();
+ test<user_defined, user_defined, user_defined>();
+
+ // should not compile
+ //test<void, void, void>();
+
+ return 0;
+}

Added: sandbox/geometry/libs/geometry/test/util/select_most_precise.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/select_most_precise.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="select_most_precise"
+ ProjectGUID="{D0982142-D3B1-4084-B724-83FB7E49EB98}"
+ RootNamespace="select_most_precise"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\select_most_precise"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\select_most_precise"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\select_most_precise.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>

Added: sandbox/geometry/libs/geometry/test/util/util_tests.sln
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/util_tests.sln 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,43 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "copy", "copy.vcproj", "{58B7C340-54BC-4B74-BA10-C289E14B2FFB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "for_each_coordinate", "for_each_coordinate.vcproj", "{900CD32E-1B78-40E3-887F-9BCCC0A1041E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select_most_precise", "select_most_precise.vcproj", "{D0982142-D3B1-4084-B724-83FB7E49EB98}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "write_dsv", "write_dsv.vcproj", "{FC796B9D-2FC4-46C1-B733-9C2C5BB48094}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "as_range", "as_range.vcproj", "{A36D8426-67EB-405C-B6E8-3FBB3374A59B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Debug|Win32.ActiveCfg = Debug|Win32
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Debug|Win32.Build.0 = Debug|Win32
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Release|Win32.ActiveCfg = Release|Win32
+ {58B7C340-54BC-4B74-BA10-C289E14B2FFB}.Release|Win32.Build.0 = Release|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Debug|Win32.Build.0 = Debug|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Release|Win32.ActiveCfg = Release|Win32
+ {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Release|Win32.Build.0 = Release|Win32
+ {D0982142-D3B1-4084-B724-83FB7E49EB98}.Debug|Win32.ActiveCfg = Debug|Win32
+ {D0982142-D3B1-4084-B724-83FB7E49EB98}.Debug|Win32.Build.0 = Debug|Win32
+ {D0982142-D3B1-4084-B724-83FB7E49EB98}.Release|Win32.ActiveCfg = Release|Win32
+ {D0982142-D3B1-4084-B724-83FB7E49EB98}.Release|Win32.Build.0 = Release|Win32
+ {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Debug|Win32.Build.0 = Debug|Win32
+ {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Release|Win32.ActiveCfg = Release|Win32
+ {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Release|Win32.Build.0 = Release|Win32
+ {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Debug|Win32.Build.0 = Debug|Win32
+ {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Release|Win32.ActiveCfg = Release|Win32
+ {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal

Added: sandbox/geometry/libs/geometry/test/util/write_dsv.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/write_dsv.cpp 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,67 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library) test file
+//
+// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands
+// Copyright Bruno Lalande 2008-2009
+// Use, modification and distribution is subject to the 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 <sstream>
+
+#include <ggl_test_common.hpp>
+
+#include <boost/geometry/util/write_dsv.hpp>
+
+
+#include <boost/geometry/geometries/geometries.hpp>
+
+#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
+
+
+
+template <typename G>
+void test_dsv(std::string const& wkt, std::string const& dsv)
+{
+ G geometry;
+
+ boost::geometry::read_wkt(wkt, geometry);
+
+ std::ostringstream out;
+ out << boost::geometry::dsv(geometry);
+ BOOST_CHECK_EQUAL(out.str(), dsv);
+}
+
+
+#ifndef GGL_TEST_MULTI
+template <typename T>
+void test_all()
+{
+ using namespace boost::geometry;
+ typedef point<T, 2, boost::geometry::cs::cartesian> P;
+
+ test_dsv<P >("POINT(1 2)", "(1, 2)");
+ test_dsv<linestring<P> >(
+ "LINESTRING(1 1,2 2,3 3)",
+ "((1, 1), (2, 2), (3, 3))");
+ test_dsv<polygon<P> >("POLYGON((0 0,0 4,4 4,4 0,0 0))",
+ "(((0, 0), (0, 4), (4, 4), (4, 0), (0, 0)))");
+
+ test_dsv<linear_ring<P> >("POLYGON((0 0,0 4,4 4,4 0,0 0))",
+ "((0, 0), (0, 4), (4, 4), (4, 0), (0, 0))");
+
+ test_dsv<box<P> >("BOX(0 0,1 1)",
+ "((0, 0), (1, 1))");
+}
+#endif
+
+
+int test_main(int, char* [])
+{
+ test_all<double>();
+ test_all<int>();
+
+
+ return 0;
+}
+

Added: sandbox/geometry/libs/geometry/test/util/write_dsv.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/util/write_dsv.vcproj 2010-02-20 10:03:37 EST (Sat, 20 Feb 2010)
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="write_dsv"
+ ProjectGUID="{FC796B9D-2FC4-46C1-B733-9C2C5BB48094}"
+ RootNamespace="write_dsv"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\write_dsv"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ ExceptionHandling="2"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\write_dsv"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../..;.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="kernel32.lib $(NoInherit)"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\write_dsv.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk