Hi All,

LinearRing behaves differently when interecting at the "junction point", see example below:

>>> from shapely.geometry import *
>>> coords = [(1,1), (0,1), (0,2), (1,2), (3,2), (3,1), (1,1)]
>>> print(Point(1.0, 1.0).buffer(0.4).intersection(LinearRing(coords)))
MULTILINESTRING ((1 1, 0.6 1), (1.4 1, 1 1))

These are the two "sides" of the junction.

Anywhere else on the ring, a simple line is returned as expected:

>>> print(Point(2.0, 2.0).buffer(0.4).intersection(LinearRing(coords)))
LINESTRING (1.6 2, 2.4 2)

Is this a bug or is it expected? What makes me think it is a bug is that with Polygons, a single polgon is returned and not a MultiPolygon:

>>> print(Point(1.0, 1.0).buffer(0.4).intersection(Polygon(coords)))
POLYGON ((0.6 ...

Any idea? Thanks!

Fabien

_______________________________________________
Community mailing list
Community@lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community

Reply via email to