Boost logo

Geometry :

Subject: [geometry] ring, multi_polygon concepts too limited or not
From: lepere renaud (lepere.renaud_at_[hidden])
Date: 2013-09-02 17:05:19


I have implemented geometric concepts above a legacy geometry structures
where ring and multi_polygon are not an stl container but i have
compiling problems on some functions while using the library.

1. intersection
BOOST_AUTO_TEST_CASE(TestPolygonUnion)
{
     Polygon poly1(Ring({{0, 0}, {10, 0}, {10, 10}, {0, 10}}));
     Polygon poly2(Ring({{5, 5}, {15, 5}, {15, 15}, {5, 15}}));

     std::vector< Polygon > polygons;

     intersection(poly1, poly2, polygons); <- in this method
     BOOST_REQUIRE_EQUAL(polygons.size(), 1u);
     BOOST_CHECK_EQUAL(area(polygons[0]), 25.0);
}

It leads to a error in backtrack_check_si.hpp
template <typename Geometry1, typename Geometry2 >
class backtrack_check_self_intersections
{
...
   // Make bad output clean
    rings.resize(size_at_start);
    ring.clear(); <- here this method does not exist

2. read_wkt
     MultiPolygon mp;
     boost::geometry::read_wkt(s, mp);

line52 of multi/io/wkt/read.hpp l52 contains "geometry.back()" while i
don't have a container. a few lines above there is a line with
traits::resize<MultiGeometry>::apply(geometry, ...) which suggests that
here geometry should not necessarly be an stl container.

As suggest by Bruno, it looks like the library is using this
ring/multi_polygon as a container while the Ring/MultiPolygon concept
specifies that Range requirements are supposed to suffice.

What could i do ?
Thanks for your help

Renaud

ps: i apologize about my previous html mails, i had not used a correct
mailer.


Geometry list run by mateusz at loskot.net