All pastes #966627 Raw Edit

Something

public text v1 · immutable
·published 2008-04-01 21:32 UTC
rendered paste body
from shapely.wkt import loads
from shapely.geometry import MultiLineString
import pylab


wkta = "MULTILINESTRING((13401 0, 13778 0), (14185 0, 14276 0), (14360 0, 15074 0))"
wktb = "MULTILINESTRING((13401 0, 13778 0), (14185 0, 14276 0), (14360 0, 15060 0), (15303 0, 15373 0), (15770 0, 15859 0), (15944 0, 16123 0), (16333 0, 16395 0))"

a = loads(wkta)
b = loads(wktb)

union = a.union(b)
mpt2 = union.boundary

print "no chaining ok", mpt2.geoms[0].coords
print "chaining", union.boundary.geoms[0].coords