Expected:
>> from shapely.geometry import LineString
>> geometry_3d = LineString(((0, 0, 1), (10, 0, 2)))
>> list(geometry_3d.buffer(2, cap_style=2).exterior.coords)
[(10.0, 2.0, 2.0), (10.0, -2.0, 2.0), (0.0, -2.0, 1.0), (0.0, 2.0, 1.0), (10.0, 2.0, 2.0)]
Current behavior:
>> from shapely.geometry import LineString
>> geometry_3d = LineString(((0, 0, 1), (10, 0, 2)))
>> list(geometry_3d.buffer(2, cap_style=2).exterior.coords)
[(10.0, 2.0), (10.0, -2.0), (0.0, -2.0), (0.0, 2.0), (10.0, 2.0)]
Create polygons with 3D coordinates and use buffer()
on it. The Z coordinates are not computed.
macOS 10.15.3
1.7.0 installed from PyPI using pip
@jrobichaud this is a known issue. I've added a new entry to the FAQ about this: https://github.com/Toblerity/Shapely/blob/master/FAQ.rst#i-used-buffer-on-a-geometry-with-z-coordinates-where-did-the-z-coordinates-go.
I think it would be appropriate to document this on the buffer
function documentation?
Done in 016d736.
Most helpful comment
Done in 016d736.