Boost logo

Geometry :

Subject: Re: [geometry] point on/intersects linestring?
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2013-09-02 10:51:57


Hi,

feverzsj wrote:
> hi, list
> Is there a function to test if a point is on a linestring?
> I tried intersects(), but compile failed.
> Also, intersects(box, linestring) won't compile.

AFAIK there isn't and intersects() for Box-Linestring isn't yet
implemented. There is a function calculating the comparable distance of
a Linestring/Segment-Box intersection but it's in the index::detail so
currently isn't a part of the official interface. Barend should I add
some parts of it to the bg::intersects()?

For now, this is how it works:

#include <boost/geometry/index/detail/algorithms/path_intersection.hpp>

/*...*/

typename bgi::detail::default_path_intersection_distance_type<Box,
Linestring>::type dummy_comp_dist;

bool are_intersecting = bgi::detail::path_intersection(box,
linestring_or_segment, dummy_comp_dist);

Regards,
Adam


Geometry list run by mateusz at loskot.net