All pastes #966595 Raw Edit

Something

public python v1 · immutable
·published 2008-04-01 21:12 UTC
rendered paste body
from shapely.wkt import loadsfrom shapely.geometry import MultiLineStringimport pylabwkta = "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)c = MultiLineString([pt.coords for pt in union.boundary.geoms])print c.wkt