We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from IPython.display import SVG, display from topojson.core.extract import Extract from shapely import geometry from shapely.ops import linemerge from shapely.ops import shared_paths
data = [ { "type": "LineString", "coordinates": [(0, 0), (10, 0), (10, 5), (20, 5)], }, { "type": "LineString", "coordinates": [(5, 0), (25, 0), (25, 5), (16, 5), (16, 10), (14, 10), (14, 5), (0, 5)], } ]
ex = Extract(data).output lines = geometry.MultiLineString(ex['linestrings']) svg_lines = lines._repr_svg_() svg_lines = svg_lines.replace('stroke="#66cc99"', 'stroke="orange"', 1) svg_lines = svg_lines.replace('stroke-width="0.54"', 'stroke-width="1.5"', 1) svg_lines = svg_lines.replace('opacity="0.8"', 'opacity="0.4"', 1) display(SVG(svg_lines))
g1 = ex['linestrings'][0] g2 = ex['linestrings'][1]
fw, bw = shared_paths(g1, g2)
linemerge(fw)
linemerge(bw)
geometry.MultiLineString([linemerge(fw), linemerge(bw)])
--------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) <ipython-input-8-7691d6f56d9d> in <module> ----> 1 geometry.MultiLineString([linemerge(fw), linemerge(bw)]) ~/miniconda3/lib/python3.7/site-packages/shapely/geometry/multilinestring.py in __init__(self, lines) 50 pass 51 else: ---> 52 self._geom, self._ndim = geos_multilinestring_from_py(lines) 53 54 def shape_factory(self, *args): ~/miniconda3/lib/python3.7/site-packages/shapely/geometry/multilinestring.py in geos_multilinestring_from_py(ob) 132 # add to coordinate sequence 133 for l in range(L): --> 134 geom, ndims = linestring.geos_linestring_from_py(obs[l]) 135 subs[l] = cast(geom, c_void_p) 136 ~/miniconda3/lib/python3.7/site-packages/shapely/speedups/_speedups.pyx in shapely.speedups._speedups.geos_linestring_from_py() ~/miniconda3/lib/python3.7/site-packages/shapely/geometry/base.py in __array_interface__(self) 792 def __array_interface__(self): 793 """Provide the Numpy array protocol.""" --> 794 raise NotImplementedError("Multi-part geometries do not themselves " 795 "provide the array interface") 796 NotImplementedError: Multi-part geometries do not themselves provide the array interface
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: