Boost logo

Boost Users :

Subject: [Boost-users] boost::geometry::model::linestring
From: alev mutlu (koor230_at_[hidden])
Date: 2014-05-11 08:16:55


Hi all,

I have the following code. I can correctly print the content of line_smp
with boost::geometry::dsv but get strange results when I copy line_smp into
a vector and then print the content of the vector.

Any ideas on what I am doing wrong?

bg::model::d2::point_xy p;
while(rs->next()){
bg::set<0>(p, i);
bg::set<1>(p, rs->getDouble("num"));
i++;
line +=p;
}
boost::geometry::simplify(line, line_smp, 0.3);

std::cout<< " original: " << boost::geometry::dsv(line) << std::endl
           << "simplified: " <<boost::geometry::dsv(line_smp) << std::endl;

         std::vector<xy> v;
         v.clear();
         std::copy(line_smp.begin(), line_smp.end(), std::back_inserter(v));

         stringstream sa, ssa;
         for(int ia = 0; ia < v.size(); ia++){
             sa << bg::get<1>(v[i]);
             cout << sa;
             sa.str("");
         }



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net