mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[test] [perimeter] Minor changes in perimeter tests to reflect comments.
This commit is contained in:
parent
16448ead2f
commit
218c554091
@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <algorithms/test_perimeter.hpp>
|
||||
#include <algorithms/perimeter/polygon_cases.hpp>
|
||||
#include <algorithms/perimeter/perimeter_polygon_cases.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
@ -21,7 +21,7 @@ struct geo_strategies
|
||||
// point radius type
|
||||
typedef typename bg::promote_floating_point
|
||||
<
|
||||
typename bg::coordinate_type<P>::type
|
||||
typename bg::coordinate_type<P>::type
|
||||
>::type rtype;
|
||||
|
||||
typedef bg::srs::spheroid<rtype> stype;
|
||||
@ -33,7 +33,7 @@ struct geo_strategies
|
||||
template <typename P>
|
||||
void test_default() //this should use andoyer strategy
|
||||
{
|
||||
for(std::size_t i = 0; i < Poly_data_geo.size(); ++i)
|
||||
for (std::size_t i = 0; i < Poly_data_geo.size(); ++i)
|
||||
{
|
||||
test_geometry<bg::model::polygon<P> >(Poly_data_geo[i],
|
||||
1116814.237 + 1116152.605);
|
||||
@ -52,7 +52,7 @@ void test_default() //this should use andoyer strategy
|
||||
template <typename P, typename N, typename Strategy>
|
||||
void test_with_strategy(N exp_length, Strategy strategy)
|
||||
{
|
||||
for(std::size_t i = 0; i < Poly_data_geo.size(); ++i)
|
||||
for (std::size_t i = 0; i < Poly_data_geo.size(); ++i)
|
||||
{
|
||||
test_geometry<bg::model::polygon<P> >(Poly_data_geo[i],
|
||||
exp_length,
|
||||
|
@ -8,23 +8,23 @@
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef POLYGON_CASES_HPP
|
||||
#define POLYGON_CASES_HPP
|
||||
#ifndef PERIMETER_POLYGON_CASES_HPP
|
||||
#define PERIMETER_POLYGON_CASES_HPP
|
||||
|
||||
#include <string>
|
||||
|
||||
static std::string Poly_data_geo_arr[] = {
|
||||
static std::string Poly_data_geo_1[] = {
|
||||
"POLYGON((0 90,1 80,1 70))",
|
||||
"POLYGON((0 90,1 80,1 80,1 80,1 70,1 70))",
|
||||
"POLYGON((0 90,1 80,1 79,1 78,1 77,1 76,1 75,1 74,\
|
||||
1 73,1 72,1 71,1 70))"
|
||||
};
|
||||
|
||||
std::vector<std::string> Poly_data_geo(Poly_data_geo_arr, Poly_data_geo_arr +
|
||||
sizeof(Poly_data_geo_arr) / sizeof(std::string));
|
||||
std::vector<std::string> Poly_data_geo(Poly_data_geo_1, Poly_data_geo_1 +
|
||||
sizeof(Poly_data_geo_1) / sizeof(std::string));
|
||||
|
||||
|
||||
static std::string Poly_data_sph_arr[] = {
|
||||
static std::string Poly_data_sph_1[] = {
|
||||
"POLYGON((0 0,180 0,0 0))",
|
||||
"POLYGON((0 0,180 0,180 0,180 0,180 180,0 0))",
|
||||
"POLYGON((0 0,180 0,180 10,180 20,180 30,180 40,180 50,180 60,\
|
||||
@ -32,15 +32,15 @@ static std::string Poly_data_sph_arr[] = {
|
||||
180 140,180 150,180 160,180 170,180 180,0 0))"
|
||||
};
|
||||
|
||||
std::vector<std::string> Poly_data_sph(Poly_data_sph_arr, Poly_data_sph_arr +
|
||||
sizeof(Poly_data_sph_arr) / sizeof(std::string));
|
||||
std::vector<std::string> Poly_data_sph(Poly_data_sph_1, Poly_data_sph_1 +
|
||||
sizeof(Poly_data_sph_1) / sizeof(std::string));
|
||||
|
||||
|
||||
static std::string Multipoly_data_arr[] = {
|
||||
static std::string Multipoly_data_1[] = {
|
||||
"MULTIPOLYGON(((0 0,180 0,0 0)), ((0 0, 0 90, 90 90, 0 0)))"
|
||||
};
|
||||
|
||||
std::vector<std::string> Multipoly_data(Multipoly_data_arr, Multipoly_data_arr +
|
||||
sizeof(Multipoly_data_arr) / sizeof(std::string));
|
||||
std::vector<std::string> Multipoly_data(Multipoly_data_1, Multipoly_data_1 +
|
||||
sizeof(Multipoly_data_1) / sizeof(std::string));
|
||||
|
||||
#endif // POLYGON_CASES_HPP
|
||||
#endif // PERIMETER_POLYGON_CASES_HPP
|
@ -9,7 +9,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <algorithms/test_perimeter.hpp>
|
||||
#include <algorithms/perimeter/polygon_cases.hpp>
|
||||
#include <algorithms/perimeter/perimeter_polygon_cases.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
@ -19,7 +19,7 @@ void test_all_default() //test the default strategy
|
||||
{
|
||||
double const pi = boost::math::constants::pi<double>();
|
||||
|
||||
for(std::size_t i = 0; i < Poly_data_sph.size(); ++i)
|
||||
for (std::size_t i = 0; i < Poly_data_sph.size(); ++i)
|
||||
{
|
||||
test_geometry<bg::model::polygon<P> >(Poly_data_sph[i], 2 * pi);
|
||||
}
|
||||
@ -40,7 +40,7 @@ void test_all_haversine(double const mean_radius)
|
||||
double const pi = boost::math::constants::pi<double>();
|
||||
bg::strategy::distance::haversine<double> haversine_strategy(mean_radius);
|
||||
|
||||
for(std::size_t i = 0; i < Poly_data_sph.size(); ++i)
|
||||
for (std::size_t i = 0; i < Poly_data_sph.size(); ++i)
|
||||
{
|
||||
test_geometry<bg::model::polygon<P> >(Poly_data_sph[i],
|
||||
2 * pi * mean_radius,
|
||||
|
Loading…
x
Reference in New Issue
Block a user