How to deal with rounding errors in Shapely
问题 I have a case which is based on projecting a point on a line and then separate this line on it. My use case is slightly more complicated, but my problem can be reproduced with the following code: from shapely import * line1 = LineString([(1,1.2), (2,2), (3, 2.), (4,1.2)]) pt = Point(2.5, 1.2) pr = line1.interpolate(line1.project(pt)) By construction, "pr" should be on line1 and their intersection too: line1.contains(pr) line1.intersects(LineString([pt, pr])) prints two times "True". But