Skip to content
Prev 22477 / 29559 Next

points sampled along a Line don't seem to intersect it

On Mon, Mar 23, 2015 at 12:07 PM, Mathieu Rajerison
<mathieu.rajerison at gmail.com> wrote:
Your points are at least 3.9x10^-17 units from the lines:

 gDistance(pts, rds.un)
[1] 3.908727e-17

I can only think this is due to a difference in how spsample and how
rgeos interpolate lines from points. FAQ 7.31 in disguise?

I suspect you could use gBuffer on your points with a buffer width of
1e-10 to get a reliable intersection, but that would be a line segment
(or segments if the point is close to a junction) but you could
possibly just take a single point from that line geometry and in the
worst case scenario you're only 1e-10 out...



Barry