Skip to content
New issue

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

buffer() drops 3rd dimension #842

Closed
jrobichaud opened this issue Feb 17, 2020 · 3 comments
Closed

buffer() drops 3rd dimension #842

jrobichaud opened this issue Feb 17, 2020 · 3 comments

Comments

@jrobichaud
Copy link

Expected behavior and actual behavior.

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)]

Steps to reproduce the problem.

Create polygons with 3D coordinates and use buffer() on it. The Z coordinates are not computed.

Operating system

macOS 10.15.3

Shapely version and provenance

1.7.0 installed from PyPI using pip

@sgillies
Copy link
Contributor

@jrobichaud
Copy link
Author

I think it would be appropriate to document this on the buffer function documentation?

@sgillies
Copy link
Contributor

Done in 016d736.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants