Skip to content

Commit

Permalink
feat: deprecate duplicate unused strategy distance_projected_point_ax
Browse files Browse the repository at this point in the history
  • Loading branch information
barendgehrels committed Aug 20, 2024
1 parent 19865f5 commit 81cc9d6
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP
#define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP

#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("This include file is deprecated and will be removed in Boost 1.88")

#include <algorithm>

Expand Down Expand Up @@ -311,5 +313,4 @@ public :

}} // namespace boost::geometry


#endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP
1 change: 0 additions & 1 deletion include/boost/geometry/strategies/strategies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include <boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp>
#include <boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp>
#include <boost/geometry/strategies/cartesian/distance_projected_point.hpp>
#include <boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp>
#include <boost/geometry/strategies/cartesian/distance_segment_box.hpp>
#include <boost/geometry/strategies/cartesian/intersection.hpp>
#include <boost/geometry/strategies/cartesian/point_in_box.hpp>
Expand Down
60 changes: 0 additions & 60 deletions test/algorithms/simplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,49 +27,6 @@
#include <test_geometries/wrapped_boost_array.hpp>
#include <test_common/test_point.hpp>

// #define TEST_PULL89
#ifdef TEST_PULL89
#include <boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp>
#endif


#ifdef TEST_PULL89
template <typename Geometry, typename T>
void test_with_ax(std::string const& wkt,
std::string const& expected,
T const& adt,
T const& xdt)
{
typedef typename bg::point_type<Geometry>::type point_type;
typedef bg::strategy::distance::detail::projected_point_ax<> ax_type;
typedef typename bg::strategy::distance::services::return_type
<
bg::strategy::distance::detail::projected_point_ax<>,
point_type,
point_type
>::type return_type;

typedef bg::strategy::distance::detail::projected_point_ax_less
<
return_type
> comparator_type;

typedef bg::strategy::simplify::detail::douglas_peucker
<
point_type,
bg::strategy::distance::detail::projected_point_ax<>,
comparator_type
> dp_ax;

return_type max_distance(adt, xdt);
comparator_type comparator(max_distance);
dp_ax strategy(comparator);

test_geometry<Geometry>(wkt, expected, max_distance, strategy);
}
#endif


template <typename P>
void test_all()
{
Expand Down Expand Up @@ -253,13 +210,6 @@ void test_all()
test_geometry<bg::model::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);


#ifdef TEST_PULL89
test_with_ax<bg::model::linestring<P> >(
"LINESTRING(0 0,120 6,80 10,200 0)",
"LINESTRING(0 0,80 10,200 0)", 10, 7);
#endif
}

template <typename P>
Expand All @@ -275,16 +225,6 @@ void test_zigzag()
test_geometry<bg::model::linestring<P> >(zigzag, expected150, 1.5001);
test_geometry<bg::model::linestring<P> >(zigzag, expected200, 2.0001);
test_geometry<bg::model::linestring<P> >(zigzag, expected225, 2.25); // should be larger than sqrt(5)=2.236

#ifdef TEST_PULL89
// This should work (results might vary but should have LESS points then expected above
// Small xtd, larger adt,
test_with_ax<bg::model::linestring<P> >(zigzag, expected100, 1.0001, 1.0001);
test_with_ax<bg::model::linestring<P> >(zigzag, expected150, 1.5001, 1.0001);
test_with_ax<bg::model::linestring<P> >(zigzag, expected200, 2.0001, 1.0001);
test_with_ax<bg::model::linestring<P> >(zigzag, expected225, 2.25, 1.0001);
#endif

}


Expand Down
45 changes: 0 additions & 45 deletions test/algorithms/test_simplify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,6 @@ struct test_inserter<bg::linestring_tag>

test_equality<Geometry>::apply(simplified, expected);
}

#ifdef TEST_PULL89
{
typedef typename bg::point_type<Geometry>::type point_type;
typedef typename bg::strategy::distance::detail::projected_point_ax<>::template result_type<point_type, point_type>::type distance_type;
typedef bg::strategy::distance::detail::projected_point_ax_less<distance_type> less_comparator;

distance_type max_distance(distance);
less_comparator less(max_distance);

bg::strategy::simplify::detail::douglas_peucker
<
point_type,
bg::strategy::distance::detail::projected_point_ax<>,
less_comparator
> strategy(less);

Geometry simplified;
bg::detail::simplify::simplify_insert(geometry,
std::back_inserter(simplified), max_distance, strategy);

test_equality<Geometry>::apply(simplified, expected);
}
#endif
}
};

Expand Down Expand Up @@ -214,27 +190,6 @@ void test_geometry(std::string const& wkt,
<
typename bg::tag<Geometry>::type
>::apply(geometry, expected, distance);

#ifdef TEST_PULL89
// Check using non-default less comparator in douglass_peucker
typedef typename bg::strategy::distance::detail::projected_point_ax<>::template result_type<point_type, point_type>::type distance_type;
typedef bg::strategy::distance::detail::projected_point_ax_less<distance_type> less_comparator;

distance_type const max_distance(distance);
less_comparator const less(max_distance);

typedef bg::strategy::simplify::detail::douglas_peucker
<
point_type,
bg::strategy::distance::detail::projected_point_ax<>,
less_comparator
> douglass_peucker_with_less;

BOOST_CONCEPT_ASSERT( (bg::concepts::SimplifyStrategy<douglass_peucker_with_less, point_type>) );

check_geometry(geometry, expected, distance, douglass_peucker_with_less(less));
check_geometry(v, expected, distance, douglass_peucker_with_less(less));
#endif
}

template <typename Geometry, typename Strategy, typename DistanceMeasure>
Expand Down
1 change: 0 additions & 1 deletion test/strategies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ foreach(item IN ITEMS
haversine
point_in_box
projected_point
projected_point_ax
pythagoras
pythagoras_point_box
segment_intersection
Expand Down
1 change: 0 additions & 1 deletion test/strategies/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ test-suite boost-geometry-strategies
[ run haversine.cpp : : : : strategies_haversine ]
[ run point_in_box.cpp : : : : strategies_point_in_box ]
[ run projected_point.cpp : : : : strategies_projected_point ]
[ run projected_point_ax.cpp : : : : strategies_projected_point_ax ]
[ run pythagoras.cpp : : : : strategies_pythagoras ]
[ run pythagoras_point_box.cpp : : : : strategies_pythagoras_point_box ]
[ run segment_intersection.cpp : : : : strategies_segment_intersection ]
Expand Down
78 changes: 0 additions & 78 deletions test/strategies/projected_point_ax.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions test/strategies/test_projected_point.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <boost/core/ignore_unused.hpp>

#include <boost/geometry/strategies/cartesian/distance_projected_point.hpp>
#include <boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp>
#include <boost/geometry/strategies/concepts/distance_concept.hpp>

#include <boost/geometry/io/wkt/read.hpp>
Expand Down Expand Up @@ -110,15 +109,6 @@ void test_check_close(T1 const& v1, T2 const& v2, double f)
BOOST_CHECK_CLOSE(v1, v2, f);
}

template <typename T1, typename T2>
void test_check_close(bg::strategy::distance::detail::projected_point_ax_result<T1> const& v1,
bg::strategy::distance::detail::projected_point_ax_result<T2> const& v2,
double f)
{
BOOST_CHECK_CLOSE(v1.atd, v2.atd, f);
BOOST_CHECK_CLOSE(v1.xtd, v2.xtd, f);
}

template <typename P1, typename P2, typename T, typename Strategy, typename ComparableStrategy>
void test_2d(std::string const& wkt_p,
std::string const& wkt_sp1,
Expand Down

0 comments on commit 81cc9d6

Please sign in to comment.