Boost logo

Geometry :

Subject: [geometry] Know the segment where two Linestrings intersect
From: Adrià Navarro López (adria_at_[hidden])
Date: 2014-07-09 11:45:15


Hi,

I'm currently using the intersection function to get the intersecting
points of two linestrings. The relevant code is the following:

BOOST_GEOMETRY_REGISTER_POINT_2D(Vec2f, double, cs::cartesian, x, y);
BOOST_GEOMETRY_REGISTER_LINESTRING(std::vector<Vec2f>);
std::vector<Vec2f> output, lineStringA, lineStringB;
boost::geometry::intersection(lineStringA, lineStringB, output);

What I would also like to know is in which segment on the linestring the
intersection happens (the index of the vector). Is there any way to obtain
that information? Or should I try to replace bg::intersection for smaller,
segment by segment calculations?

Thanks



Geometry list run by mateusz at loskot.net