On Jan 28, 2010, at 11:55 PM, Roy Hyunjin Han wrote:
> I think this is a GEOS bug due to roundoff errors, but the following
> assertion (interpolated points should intersect the lines from which
> they were interpolated) fails. I'll investigate the issue with the
> GEOS
> people. Also, sorry if I haven't responded to emails; I'll catch up
> as
> soon.
>
> from shapely.wkt import loads
>
> m = loads("""MULTILINESTRING ((336700.9845364579814486
> 1738886.2085458301007748, 343584.4261802079854533
> 1738555.8341833299491554), (343584.4261802079854533
> 1738555.8341833299491554, 350539.0000000000000000
> 1736135.0000000000000000), (350539.0000000000000000
> 1736135.0000000000000000, 353532.0000000000000000
> 1733674.0000000000000000))""")
>
> p = loads("""POINT (344705.7704083333374001
> 1737219.7509562498889863)""")
>
> assert m.intersects(m.interpolate(m.project(p))) == True
I just got a pair of email about GEOS #323. Point and line
intersection is fraught with numerical precision problems. Using a
geometry's distance method, you can implement something like an
"almostIntersects":
bool(a.distance(b) <= tolerance)
Would be nice if GEOS projection and interpolation were exactly
inverse, but that's not the case.
--
Sean
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community