turf.lineIntersect returns inaccurate points

Created on 18 Jan 2019  路  3Comments  路  Source: Turfjs/turf

I've noticed while using turf.lineIntersect that the points it returns aren't exactly on the point of intersection. This can be seen on the demo on the main turf documentation if you zoom in on the intersection.

2019-01-18 12_34_26-turf js _ advanced geospatial analysis

Possibly related to https://github.com/Turfjs/turf/issues/965#issuecomment-354978429

bug

Most helpful comment

I also encountered this problem, is there a solution?

All 3 comments

Hi @robhawkes

Yeah I think the initial implementation was a hand rolled version that is probably suitable for short distances only. There is an option of this page that is better suited for global curvature, it would be nice to include it but it'll probably take a little while.

Cheers
Rowan

Hi @robhawkes

So I took a look into this and I think there is something funky going on with the rendering in browser that makes it appear more inaccurate than it is.

I pulled the same data in QGIS and the intersection point appears to be 3cm off which I suspect can be accounted for by the global curvature.
qgis

In the browser for some reason the intersection point is shown on the north of the line running east-west. Whereas in QGIS it's shown on the south...

So I think I'm going to close this issue unless you think there is anything further worth investigating...

I also encountered this problem, is there a solution?

Was this page helpful?
0 / 5 - 0 ratings