mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 05:24:02 +00:00
Renamed linear_ring to ring (linear_ring is still available)
[SVN r68387]
This commit is contained in:
parent
1e823499b6
commit
e0a240b770
@ -72,7 +72,7 @@ int main(void)
|
||||
// Let's add one
|
||||
{
|
||||
poly.inners().resize(1);
|
||||
model::linear_ring<point_2d>& inner = poly.inners().back();
|
||||
model::ring<point_2d>& inner = poly.inners().back();
|
||||
|
||||
const double coor[][2] = { {4.0, 2.0}, {4.2, 1.4}, {4.8, 1.9}, {4.4, 2.2}, {4.0, 2.0} };
|
||||
assign(inner, coor);
|
||||
|
@ -97,7 +97,7 @@ int main()
|
||||
//boost::geometry::union<ring_type>(a, b, unioned);
|
||||
|
||||
/* This once worked, using pointers, but has to be fixed or deprecated
|
||||
typedef boost::geometry::model::linear_ring<boost::geometry::model::d2::point_xy<double> > ring_2d;
|
||||
typedef boost::geometry::model::ring<boost::geometry::model::d2::point_xy<double> > ring_2d;
|
||||
std::vector<ring_2d> unioned;
|
||||
std::vector<ring_2d> intersected;
|
||||
|
||||
|
@ -136,7 +136,7 @@ int main()
|
||||
geometry_of = {{{}}};
|
||||
|
||||
// Initialize a ring:
|
||||
typedef bg::model::linear_ring<bg::model::d2::point_xy<double> > ring_type;
|
||||
typedef bg::model::ring<bg::model::d2::point_xy<double> > ring_type;
|
||||
ring_type ring = geometry_of(16, 1)(15,2)(14, 3)(13,4)(12, 3.14)(1,6);
|
||||
std::cout << bg::wkt(ring) << std::endl;
|
||||
|
||||
|
@ -51,7 +51,7 @@ int main()
|
||||
try
|
||||
{
|
||||
{
|
||||
shape_creator<bg::model::linear_ring<point_type> > sc("out/pol");
|
||||
shape_creator<bg::model::ring<point_type> > sc("out/pol");
|
||||
sc.AddField<int>("dummy", 10);
|
||||
int r = sc.AddGeomFromText("POLYGON((0 0,0 1,1 1,1 0,0 0))");
|
||||
sc.WriteField(r, 0, 10);
|
||||
|
@ -105,7 +105,7 @@ int main()
|
||||
BOOST_FOREACH(polygon_type const& polygon, country)
|
||||
{
|
||||
// Ignore holes, so take only exterior ring
|
||||
bg::model::linear_ring<point_type> const& ring = bg::exterior_ring(polygon);
|
||||
bg::model::ring<point_type> const& ring = bg::exterior_ring(polygon);
|
||||
|
||||
// If wished, suppress too small polygons.
|
||||
// (Note that even in latlong, area is calculated in square meters)
|
||||
|
@ -43,7 +43,7 @@ template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
test_geometry<bg::model::linestring<P> >();
|
||||
test_geometry<bg::model::linear_ring<P> >();
|
||||
test_geometry<bg::model::ring<P> >();
|
||||
test_geometry<bg::model::polygon<P> >();
|
||||
|
||||
test_geometry<std::vector<P> >();
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/linear_ring.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
//#define GEOMETRY_TEST_DEBUG
|
||||
@ -30,8 +30,8 @@ void test_all()
|
||||
|
||||
|
||||
// clockwise rings (second is wrongly ordered)
|
||||
test_geometry<bg::model::linear_ring<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0);
|
||||
test_geometry<bg::model::linear_ring<P> >("POLYGON((0 0,2 0,4 2,0 7,0 0))", -16.0);
|
||||
test_geometry<bg::model::ring<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0);
|
||||
test_geometry<bg::model::ring<P> >("POLYGON((0 0,2 0,4 2,0 7,0 0))", -16.0);
|
||||
|
||||
test_geometry<bg::model::polygon<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", 16.0);
|
||||
test_geometry<bg::model::polygon<P> >("POLYGON((1 1,2 1,2 2,1 2,1 1))", -1.0);
|
||||
|
@ -20,7 +20,7 @@ void test_2d()
|
||||
test_centroid<bg::model::linestring<P> >("LINESTRING(0 0,0 4, 4 4)", 1.0, 3.0);
|
||||
test_centroid<bg::model::linestring<P> >("LINESTRING(0 0,3 3,0 6,3 9,0 12)", 1.5, 6.0);
|
||||
|
||||
test_centroid<bg::model::linear_ring<P> >(
|
||||
test_centroid<bg::model::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);
|
||||
@ -39,15 +39,15 @@ void test_2d()
|
||||
|
||||
|
||||
// ccw
|
||||
test_centroid<bg::model::linear_ring<P, false> >(
|
||||
test_centroid<bg::model::ring<P, 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);
|
||||
|
||||
// open / closed
|
||||
test_centroid<bg::model::linear_ring<P, true, true> >(
|
||||
test_centroid<bg::model::ring<P, true, true> >(
|
||||
"POLYGON((1 1,2 2,3 1,2 0,1 1))", 2.0, 1.0);
|
||||
test_centroid<bg::model::linear_ring<P, true, false> >(
|
||||
test_centroid<bg::model::ring<P, true, false> >(
|
||||
"POLYGON((1 1,2 2,3 1,2 0))", 2.0, 1.0);
|
||||
|
||||
test_centroid<bg::model::box<P> >("POLYGON((1 2,3 4))", 2, 3);
|
||||
|
@ -43,7 +43,7 @@ void test_std()
|
||||
test_all<P>();
|
||||
|
||||
typedef bg::model::box<P> box_type;
|
||||
typedef bg::model::linear_ring<P> ring_type;
|
||||
typedef bg::model::ring<P> ring_type;
|
||||
typedef bg::model::polygon<P> polygon_type;
|
||||
|
||||
box_type b;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/linear_ring.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
|
||||
@ -73,34 +73,34 @@ void test_all()
|
||||
std::string ccw_open_ring = "POLYGON((0 0,1 0,1 1,0 1))";
|
||||
|
||||
// already cw_ring
|
||||
test_geometry<bg::model::linear_ring<P> >(cw_ring, cw_ring);
|
||||
test_geometry<bg::model::ring<P> >(cw_ring, cw_ring);
|
||||
|
||||
// wrong order
|
||||
test_geometry<bg::model::linear_ring<P> >(ccw_ring, cw_ring);
|
||||
test_geometry<bg::model::ring<P> >(ccw_ring, cw_ring);
|
||||
|
||||
// ccw-ring, input ccw-ring, already correct
|
||||
test_geometry<bg::model::linear_ring<P, false> >(ccw_ring, ccw_ring);
|
||||
test_geometry<bg::model::ring<P, false> >(ccw_ring, ccw_ring);
|
||||
|
||||
// ccw-ring, input cw-ring, corrected
|
||||
test_geometry<bg::model::linear_ring<P, false> >(cw_ring, ccw_ring);
|
||||
test_geometry<bg::model::ring<P, false> >(cw_ring, ccw_ring);
|
||||
|
||||
// open-ring, input ccw-ring, already correct
|
||||
test_geometry<bg::model::linear_ring<P, true, false> >(cw_open_ring, cw_open_ring);
|
||||
test_geometry<bg::model::ring<P, true, false> >(cw_open_ring, cw_open_ring);
|
||||
|
||||
// ccw-ring, input cw-ring, corrected
|
||||
test_geometry<bg::model::linear_ring<P, true, false> >(ccw_open_ring, "POLYGON((0 1,1 1,1 0,0 0))");
|
||||
test_geometry<bg::model::ring<P, true, false> >(ccw_open_ring, "POLYGON((0 1,1 1,1 0,0 0))");
|
||||
|
||||
|
||||
|
||||
// not closed
|
||||
test_geometry<bg::model::linear_ring<P> >(
|
||||
test_geometry<bg::model::ring<P> >(
|
||||
ccw_open_ring,
|
||||
cw_ring);
|
||||
|
||||
// counter clockwise, cw_ring
|
||||
test_geometry<bg::model::linear_ring<P, false> >(ccw_ring, ccw_ring);
|
||||
test_geometry<bg::model::ring<P, false> >(ccw_ring, ccw_ring);
|
||||
|
||||
test_geometry<bg::model::linear_ring<P, false> >(cw_ring, ccw_ring);
|
||||
test_geometry<bg::model::ring<P, false> >(cw_ring, ccw_ring);
|
||||
|
||||
|
||||
// polygon: cw_ring
|
||||
|
@ -76,7 +76,7 @@ void test_all()
|
||||
// Note that intersections are tested elsewhere, they don't need
|
||||
// thorough test at this place
|
||||
typedef bg::model::polygon<P> polygon;
|
||||
typedef bg::model::linear_ring<P> ring;
|
||||
typedef bg::model::ring<P> ring;
|
||||
|
||||
// Four times same test with other types
|
||||
test_disjoint<polygon, polygon>("disjoint_simplex_pp", disjoint_simplex[0], disjoint_simplex[1], true);
|
||||
|
@ -16,7 +16,7 @@
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
typedef bg::model::linear_ring<P> ring;
|
||||
typedef bg::model::ring<P> ring;
|
||||
typedef bg::model::polygon<P> polygon;
|
||||
|
||||
// Simplex
|
||||
|
@ -177,12 +177,12 @@ void test_all()
|
||||
test_geometry<bg::model::linestring<P>, P>("LINESTRING(1 1,4 4)", "POINT(1 3)", sqrt(2.0));
|
||||
|
||||
// Rings
|
||||
test_geometry<P, bg::model::linear_ring<P> >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0));
|
||||
test_geometry<P, bg::model::linear_ring<P> >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0);
|
||||
test_geometry<P, bg::model::ring<P> >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0));
|
||||
test_geometry<P, bg::model::ring<P> >("POINT(3 1)", "POLYGON((1 1,4 4,5 0,1 1))", 0.0);
|
||||
// other way round
|
||||
test_geometry<bg::model::linear_ring<P>, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0);
|
||||
test_geometry<bg::model::ring<P>, P>("POLYGON((1 1,4 4,5 0,1 1))", "POINT(3 1)", 0.0);
|
||||
// open ring
|
||||
test_geometry<P, bg::model::linear_ring<P, true, false> >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0));
|
||||
test_geometry<P, bg::model::ring<P, true, false> >("POINT(1 3)", "POLYGON((4 4,5 0,1 1))", sqrt(2.0));
|
||||
|
||||
// Polygons
|
||||
test_geometry<P, bg::model::polygon<P> >("POINT(1 3)", "POLYGON((1 1,4 4,5 0,1 1))", sqrt(2.0));
|
||||
|
@ -23,16 +23,16 @@ void test_2d()
|
||||
test_envelope<bg::model::linestring<P> >("LINESTRING(1 1,2 2)", 1, 2, 1, 2);
|
||||
test_envelope<bg::model::polygon<P> >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3);
|
||||
|
||||
test_envelope<bg::model::linear_ring<P> >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3);
|
||||
test_envelope<bg::model::ring<P> >("POLYGON((1 1,1 3,3 3,3 1,1 1))", 1, 3, 1, 3);
|
||||
test_envelope<bg::model::box<P> >("BOX(1 1,3 3)", 1, 3, 1, 3);
|
||||
|
||||
// Triangle, closed and open, and CCW.
|
||||
// Note that for the envelope algorithm,
|
||||
// these combinations should theoretically not differ
|
||||
test_envelope<bg::model::linear_ring<P> >("POLYGON((4 1,0 7,7 9,4 1))", 0, 7, 1, 9);
|
||||
test_envelope<bg::model::linear_ring<P, true, false> >("POLYGON((4 1,0 7,7 9))", 0, 7, 1, 9);
|
||||
test_envelope<bg::model::linear_ring<P, false> >("POLYGON((4 1,7 9,0 7,4 1))", 0, 7, 1, 9);
|
||||
test_envelope<bg::model::linear_ring<P, false, false> >("POLYGON((4 1,7 9,0 7))", 0, 7, 1, 9);
|
||||
test_envelope<bg::model::ring<P> >("POLYGON((4 1,0 7,7 9,4 1))", 0, 7, 1, 9);
|
||||
test_envelope<bg::model::ring<P, true, false> >("POLYGON((4 1,0 7,7 9))", 0, 7, 1, 9);
|
||||
test_envelope<bg::model::ring<P, false> >("POLYGON((4 1,7 9,0 7,4 1))", 0, 7, 1, 9);
|
||||
test_envelope<bg::model::ring<P, false, false> >("POLYGON((4 1,7 9,0 7))", 0, 7, 1, 9);
|
||||
|
||||
typedef std::pair<P, P> segment_type;
|
||||
test_envelope<segment_type>("SEGMENT(1 1,3 3)", 1, 3, 1, 3);
|
||||
|
@ -16,7 +16,7 @@ template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
typedef bg::model::box<P> box;
|
||||
typedef bg::model::linear_ring<P> ring;
|
||||
typedef bg::model::ring<P> ring;
|
||||
typedef bg::model::polygon<P> polygon;
|
||||
typedef bg::model::linestring<P> linestring;
|
||||
|
||||
|
@ -40,7 +40,7 @@ void test_all()
|
||||
, std::sqrt(2.0)
|
||||
, "LINESTRING(10 1,2 2)"
|
||||
);
|
||||
test_geometry<bg::model::linear_ring<P> >
|
||||
test_geometry<bg::model::ring<P> >
|
||||
(
|
||||
"POLYGON((1 1,1 4,4 4,4 1,1 1))"
|
||||
|
||||
|
@ -55,7 +55,7 @@ inline typename bg::coordinate_type<Geometry1>::type intersect(Geometry1 const&
|
||||
bg::enrich_intersection_points<rev<Geometry1>::value, rev<Geometry2>::value >(turns, bg::detail::overlay::operation_intersection,
|
||||
g1, g2, side_strategy_type());
|
||||
|
||||
typedef bg::model::linear_ring<typename bg::point_type<Geometry1>::type> ring_type;
|
||||
typedef bg::model::ring<typename bg::point_type<Geometry1>::type> ring_type;
|
||||
typedef std::deque<ring_type> out_vector;
|
||||
out_vector v;
|
||||
|
||||
|
@ -144,7 +144,7 @@ struct test_traverse
|
||||
: bg::detail::overlay::operation_intersection,
|
||||
g1, g2, side_strategy_type());
|
||||
|
||||
typedef bg::model::linear_ring<typename bg::point_type<G2>::type> ring_type;
|
||||
typedef bg::model::ring<typename bg::point_type<G2>::type> ring_type;
|
||||
typedef std::vector<ring_type> out_vector;
|
||||
out_vector v;
|
||||
|
||||
|
@ -71,7 +71,7 @@ void test_traverse(std::string const& caseid, G1 const& g1, G2 const& g2)
|
||||
bg::get_turns<false, false, bg::detail::overlay::calculate_distance_policy>(g1, g2, ips);
|
||||
bg::enrich_intersection_points(ips, g1, g2, strategy_type());
|
||||
|
||||
typedef bg::model::linear_ring<typename bg::point_type<G2>::type> ring_type;
|
||||
typedef bg::model::ring<typename bg::point_type<G2>::type> ring_type;
|
||||
typedef std::vector<ring_type> out_vector;
|
||||
out_vector v;
|
||||
|
||||
|
@ -17,7 +17,7 @@ void test_all()
|
||||
// 3-4-5 triangle
|
||||
//test_geometry<std::pair<P, P> >("LINESTRING(0 0,3 4)", 5);
|
||||
|
||||
test_geometry<bg::model::linear_ring<P> >(
|
||||
test_geometry<bg::model::ring<P> >(
|
||||
"POLYGON((0 0,0 1,1 1,1 0,0 0))", 4);
|
||||
test_geometry<bg::model::polygon<P> >(
|
||||
"POLYGON((0 0,0 1,1 0,0 0))", 1.0 + 1.0 + sqrt(2.0));
|
||||
|
@ -38,7 +38,7 @@ void test_all()
|
||||
// Check compilation
|
||||
test_geometry<Point>("POINT(0 0)", "POINT(0 0)");
|
||||
|
||||
test_geometry<bg::model::linear_ring<Point> >(
|
||||
test_geometry<bg::model::ring<Point> >(
|
||||
"POLYGON((4 0,8 2,8 7,4 9,0 7,0 2,2 1,4 0))",
|
||||
"POLYGON((4 0,2 1,0 2,0 7,4 9,8 7,8 2,4 0))");
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ void test_all()
|
||||
"LINESTRING(0 0,5 5,7 5,10 10)",
|
||||
"LINESTRING(0 0,5 5,7 5,10 10)", 1.0);
|
||||
|
||||
test_geometry<bg::model::linear_ring<P> >(
|
||||
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);
|
||||
|
||||
@ -65,7 +65,7 @@ union all select astext(ST_Simplify(geomfromtext('POLYGON((4 0, 8 2, 8 7, 4 9, 0
|
||||
"POINT(0 0)", 1.0);
|
||||
|
||||
|
||||
test_geometry<bg::model::linear_ring<P> >(
|
||||
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);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#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/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
|
||||
|
@ -14,7 +14,7 @@
|
||||
#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/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
|
||||
|
@ -14,7 +14,7 @@
|
||||
#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/ring.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/extensions/gis/io/wkt/read_wkt.hpp>
|
||||
@ -44,7 +44,7 @@ template <typename Point, bool Clockwise, bool Closed>
|
||||
void test_ordered_ring(std::string const& wkt_point,
|
||||
std::string const& wkt_geometry, bool expected, bool on_border)
|
||||
{
|
||||
typedef bg::model::linear_ring<Point, Clockwise, Closed> ring_type;
|
||||
typedef bg::model::ring<Point, Clockwise, Closed> ring_type;
|
||||
ring_type ring;
|
||||
Point point;
|
||||
|
||||
|
@ -223,19 +223,19 @@ template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
typedef bg::model::polygon<P> polygon;
|
||||
typedef bg::model::linear_ring<P> ring;
|
||||
typedef bg::model::ring<P> ring;
|
||||
typedef bg::model::box<P> box;
|
||||
|
||||
test_areal<ring, polygon>();
|
||||
|
||||
// Open
|
||||
test_areal<bg::model::linear_ring<P, true, false>, bg::model::polygon<P, true, false> >();
|
||||
test_areal<bg::model::ring<P, true, false>, bg::model::polygon<P, true, false> >();
|
||||
|
||||
// Counter clockwise
|
||||
test_areal<bg::model::linear_ring<P, false>, bg::model::polygon<P, false> >();
|
||||
test_areal<bg::model::ring<P, false>, bg::model::polygon<P, false> >();
|
||||
|
||||
// Counter clockwise and open
|
||||
test_areal<bg::model::linear_ring<P, false, false>, bg::model::polygon<P, false, false> >();
|
||||
test_areal<bg::model::ring<P, false, false>, bg::model::polygon<P, false, false> >();
|
||||
|
||||
test_one<polygon, box, polygon>("box_ring", example_box, example_ring,
|
||||
1, 1, 15, 6.38875);
|
||||
|
@ -32,7 +32,7 @@ void test_all()
|
||||
"LINESTRING(0 0,1 1)");
|
||||
|
||||
// Other types
|
||||
test_geometry<bg::model::linear_ring<Point> >(
|
||||
test_geometry<bg::model::ring<Point> >(
|
||||
"POLYGON((0 0,0 1,1 1,1 1,1 1,1 0,0 0,0 0))",
|
||||
"POLYGON((0 0,0 1,1 1,1 0,0 0))");
|
||||
|
||||
|
@ -36,7 +36,7 @@ void test_all()
|
||||
test_geometry<P, D>();
|
||||
test_geometry<P const, D>();
|
||||
test_geometry<bg::model::linestring<P> , D>();
|
||||
test_geometry<bg::model::linear_ring<P> , D>();
|
||||
test_geometry<bg::model::ring<P> , D>();
|
||||
test_geometry<bg::model::polygon<P> , D>();
|
||||
test_geometry<bg::model::box<P> , D>();
|
||||
test_geometry<bg::model::segment<P> , D>();
|
||||
|
@ -37,7 +37,7 @@ void test_all()
|
||||
test_geometry<P, Expected>();
|
||||
test_geometry<P const, Expected>();
|
||||
test_geometry<bg::model::linestring<P> , Expected>();
|
||||
test_geometry<bg::model::linear_ring<P> , Expected>();
|
||||
test_geometry<bg::model::ring<P> , Expected>();
|
||||
test_geometry<bg::model::polygon<P> , Expected>();
|
||||
test_geometry<bg::model::box<P> , Expected>();
|
||||
test_geometry<bg::model::segment<P> , Expected>();
|
||||
|
@ -37,7 +37,7 @@ void test_all()
|
||||
test_geometry<P, Expected>();
|
||||
test_geometry<P const, Expected>();
|
||||
test_geometry<bg::model::linestring<P> , Expected>();
|
||||
test_geometry<bg::model::linear_ring<P> , Expected>();
|
||||
test_geometry<bg::model::ring<P> , Expected>();
|
||||
test_geometry<bg::model::polygon<P> , Expected>();
|
||||
test_geometry<bg::model::box<P> , Expected>();
|
||||
test_geometry<bg::model::segment<P> , Expected>();
|
||||
|
@ -35,7 +35,7 @@ void test_all()
|
||||
test_geometry<P, 1>();
|
||||
test_geometry<P const, 1>();
|
||||
test_geometry<bg::model::linestring<P> , 2>();
|
||||
test_geometry<bg::model::linear_ring<P> , 93>();
|
||||
test_geometry<bg::model::ring<P> , 93>();
|
||||
test_geometry<bg::model::polygon<P> , 3>();
|
||||
test_geometry<bg::model::box<P> , 94>();
|
||||
test_geometry<bg::model::segment<P> , 92>();
|
||||
|
@ -36,7 +36,7 @@ void test_all()
|
||||
test_geometry<P, P>();
|
||||
test_geometry<P const, P>();
|
||||
test_geometry<bg::model::linestring<P> , P>();
|
||||
test_geometry<bg::model::linear_ring<P> , P>();
|
||||
test_geometry<bg::model::ring<P> , P>();
|
||||
test_geometry<bg::model::polygon<P> , P>();
|
||||
test_geometry<bg::model::box<P> , P>();
|
||||
test_geometry<bg::model::segment<P> , P>();
|
||||
|
@ -30,9 +30,9 @@ void test_all()
|
||||
test_reversed<P, P, false>();
|
||||
test_reversed<P, bg::model::linestring<P>, false>();
|
||||
test_reversed<bg::model::linestring<P>, P, true>();
|
||||
test_reversed<bg::model::linear_ring<P>, P, true>();
|
||||
test_reversed<bg::model::linestring<P>, bg::model::linear_ring<P>, false>();
|
||||
test_reversed<bg::model::linear_ring<P>, bg::model::linestring<P>, true>();
|
||||
test_reversed<bg::model::ring<P>, P, true>();
|
||||
test_reversed<bg::model::linestring<P>, bg::model::ring<P>, false>();
|
||||
test_reversed<bg::model::ring<P>, bg::model::linestring<P>, true>();
|
||||
}
|
||||
|
||||
template <typename P1, typename P2>
|
||||
|
@ -35,7 +35,7 @@ void test_all()
|
||||
test_geometry<P, bg::point_tag>();
|
||||
test_geometry<P const, bg::point_tag>();
|
||||
test_geometry<bg::model::linestring<P> , bg::linestring_tag>();
|
||||
test_geometry<bg::model::linear_ring<P> , bg::ring_tag>();
|
||||
test_geometry<bg::model::ring<P> , bg::ring_tag>();
|
||||
test_geometry<bg::model::polygon<P> , bg::polygon_tag>();
|
||||
test_geometry<bg::model::box<P> , bg::box_tag>();
|
||||
test_geometry<bg::model::segment<P> , bg::segment_tag>();
|
||||
|
@ -34,7 +34,7 @@ void test_all()
|
||||
test_geometry<P, 0>();
|
||||
test_geometry<P const, 0>();
|
||||
test_geometry<bg::model::linestring<P> , 1>();
|
||||
test_geometry<bg::model::linear_ring<P> , 2>(); // being discussed
|
||||
test_geometry<bg::model::ring<P> , 2>(); // being discussed
|
||||
test_geometry<bg::model::polygon<P> , 2>();
|
||||
test_geometry<bg::model::box<P> , 2>();
|
||||
test_geometry<bg::model::segment<P> , 1>();
|
||||
|
@ -100,7 +100,7 @@ void test_geometry(std::string const& id, std::string const& wkt, Policy const&
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
typedef bg::model::linear_ring<P> ring;
|
||||
typedef bg::model::ring<P> ring;
|
||||
typedef bg::model::polygon<P> polygon;
|
||||
typedef bg::model::multi_polygon<polygon> mp;
|
||||
|
||||
|
@ -37,7 +37,7 @@ void test_remove_holes_if(std::string const& wkt, Predicate const& predicate,
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
bg::elongated_hole<bg::model::linear_ring<P> > elongated(0.05);
|
||||
bg::elongated_hole<bg::model::ring<P> > elongated(0.05);
|
||||
|
||||
// No holes
|
||||
test_remove_holes_if<bg::model::polygon<P> >("POLYGON((0 0,0 4,4 4,4 0,0 0))", elongated, 5);
|
||||
@ -52,7 +52,7 @@ void test_all()
|
||||
test_remove_holes_if<bg::model::polygon<P> >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2))", elongated, 5);
|
||||
|
||||
// Invalid hole
|
||||
bg::invalid_hole<bg::model::linear_ring<P> > invalid;
|
||||
bg::invalid_hole<bg::model::ring<P> > invalid;
|
||||
test_remove_holes_if<bg::model::polygon<P> >("POLYGON((0 0,0 4,4 4,4 0,0 0), (1 1,1 2))", invalid, 5);
|
||||
|
||||
// Valid hole
|
||||
|
@ -60,7 +60,7 @@ void test_all()
|
||||
test_selected<bg::model::linestring<P> >("LINESTRING(1 2)", P(1,1), false, 0.0001);
|
||||
|
||||
// nyi
|
||||
//test_selected<bg::model::linear_ring<P> >();
|
||||
//test_selected<bg::model::ring<P> >();
|
||||
|
||||
test_selected<bg::model::polygon<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(0.001, 0.001), true, 0.0001);
|
||||
test_selected<bg::model::polygon<P> >("POLYGON((0 0,0 7,4 2,2 0,0 0))", P(1, 1), true, 0.0001);
|
||||
|
@ -126,7 +126,7 @@ void test_all()
|
||||
|
||||
// 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<bg::model::linear_ring<P> >("POLYGON((0 0,0 1,1 1,1 0,0 0))", 5, 0, 1, 4);
|
||||
test_wkt<bg::model::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)
|
||||
@ -177,7 +177,7 @@ void test_all()
|
||||
}
|
||||
|
||||
test_wkt_output_iterator<bg::model::linestring<P> >("LINESTRING(1 1,2 2,3 3)");
|
||||
test_wkt_output_iterator<bg::model::linear_ring<P> >("POLYGON((1 1,2 2,3 3))");
|
||||
test_wkt_output_iterator<bg::model::ring<P> >("POLYGON((1 1,2 2,3 3))");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <boost/geometry/algorithms/within.hpp>
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/linear_ring.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
@ -24,7 +24,7 @@ int test_main( int , char* [] )
|
||||
{
|
||||
typedef bg::model::d2::point_xy<double> gl_point;
|
||||
typedef bg::circle gl_circle;
|
||||
typedef bg::model::linear_ring<gl_point> gl_ring;
|
||||
typedef bg::model::ring<gl_point> gl_ring;
|
||||
typedef bg::model::polygon<gl_point> gl_polygon;
|
||||
typedef bg::multi_polygon<gl_polygon> gl_multi_polygon;
|
||||
|
||||
|
@ -36,7 +36,7 @@ void test_all()
|
||||
test_geometry<P, P>();
|
||||
test_geometry<const P, P>();
|
||||
test_geometry<bg::model::linestring<P> , P>();
|
||||
test_geometry<bg::model::linear_ring<P> , P>();
|
||||
test_geometry<bg::model::ring<P> , P>();
|
||||
test_geometry<bg::model::polygon<P> , P>();
|
||||
test_geometry<bg::model::box<P> , P>();
|
||||
test_geometry<bg::segment<P> , P>();
|
||||
|
@ -56,7 +56,7 @@ int test_main(int, char* [])
|
||||
boost::polygon::polygon_data<double> r1;
|
||||
r1.set(point_vector.begin(), point_vector.end());
|
||||
|
||||
bg::model::linear_ring<bg_point> r2;
|
||||
bg::model::ring<bg_point> r2;
|
||||
r2.push_back(bg_point(0, 0));
|
||||
r2.push_back(bg_point(0, 3));
|
||||
r2.push_back(bg_point(4, 0));
|
||||
|
@ -100,7 +100,7 @@ template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
test_non_geometry();
|
||||
test_geometry<bg::model::linear_ring<P> >("POLYGON((1 1,1 4,4 4,4 1))");
|
||||
test_geometry<bg::model::ring<P> >("POLYGON((1 1,1 4,4 4,4 1))");
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#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/ring.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
|
@ -13,7 +13,7 @@
|
||||
#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/ring.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
@ -136,22 +136,22 @@ template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
typedef bg::model::box<P> box;
|
||||
typedef bg::model::linear_ring<P> ring;
|
||||
typedef bg::model::ring<P> ring;
|
||||
typedef bg::model::polygon<P> polygon;
|
||||
typedef bg::model::multi_polygon<polygon> multi_polygon;
|
||||
test_areal<ring, polygon, multi_polygon>();
|
||||
|
||||
typedef bg::model::linear_ring<P, false> ring_ccw;
|
||||
typedef bg::model::ring<P, false> ring_ccw;
|
||||
typedef bg::model::polygon<P, false> polygon_ccw;
|
||||
typedef bg::model::multi_polygon<polygon_ccw> multi_polygon_ccw;
|
||||
test_areal<ring_ccw, polygon_ccw, multi_polygon_ccw>();
|
||||
|
||||
typedef bg::model::linear_ring<P, true, false> ring_open;
|
||||
typedef bg::model::ring<P, true, false> ring_open;
|
||||
typedef bg::model::polygon<P, true, false> polygon_open;
|
||||
typedef bg::model::multi_polygon<polygon_open> multi_polygon_open;
|
||||
test_areal<ring_open, polygon_open, multi_polygon_open>();
|
||||
|
||||
typedef bg::model::linear_ring<P, false, false> ring_open_ccw;
|
||||
typedef bg::model::ring<P, false, false> ring_open_ccw;
|
||||
typedef bg::model::polygon<P, false, false> polygon_open_ccw;
|
||||
typedef bg::model::multi_polygon<polygon_open_ccw> multi_polygon_open_ccw;
|
||||
test_areal<ring_open_ccw, polygon_open_ccw, multi_polygon_open_ccw>();
|
||||
|
@ -12,7 +12,7 @@
|
||||
#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/ring.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
|
@ -109,14 +109,14 @@ void test_all()
|
||||
{
|
||||
|
||||
{
|
||||
typedef bg::model::linear_ring<P> ring;
|
||||
typedef bg::model::ring<P> ring;
|
||||
typedef bg::model::polygon<P> polygon;
|
||||
typedef bg::model::multi_polygon<polygon> multi_polygon;
|
||||
test_areal<ring, polygon, multi_polygon>();
|
||||
}
|
||||
|
||||
{
|
||||
typedef bg::model::linear_ring<P, false> ring_ccw;
|
||||
typedef bg::model::ring<P, false> ring_ccw;
|
||||
typedef bg::model::polygon<P, false> polygon_ccw;
|
||||
typedef bg::model::multi_polygon<polygon_ccw> multi_polygon_ccw;
|
||||
// TODO: ccw has issues with multi-touch
|
||||
|
@ -47,7 +47,7 @@ void test_all()
|
||||
test_dsv<model::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<model::linear_ring<P> >("POLYGON((0 0,0 4,4 4,4 0,0 0))",
|
||||
test_dsv<model::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<model::box<P> >("BOX(0 0,1 1)",
|
||||
|
@ -111,7 +111,7 @@ void test_geometry(std::string const& wkt,
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
test_geometry<bg::model::linear_ring<P> >(
|
||||
test_geometry<bg::model::ring<P> >(
|
||||
"POLYGON((1 1,1 4,4 4,4 1))",
|
||||
"(1, 1) (1, 4) (4, 4) (4, 1)",
|
||||
"(1, 1) (1, 4) (4, 4) (4, 1) (1, 1)");
|
||||
|
@ -140,7 +140,7 @@ void test_geometry(std::string const& wkt,
|
||||
template <typename P>
|
||||
void test_all()
|
||||
{
|
||||
test_geometry<bg::model::linear_ring<P> >(
|
||||
test_geometry<bg::model::ring<P> >(
|
||||
"POLYGON((1 1,1 4,4 4,4 1))",
|
||||
"(1, 1) (1, 4) (4, 4) (4, 1)",
|
||||
"(4, 1) (4, 4) (1, 4) (1, 1)",
|
||||
|
Loading…
x
Reference in New Issue
Block a user