from_shapely failing with shapely==1.8.3
See original GitHub issueUsing pygeos==0.12.0
, the following test passes on shapely==1.8.2
, but fails on shapely==1.8.3
:
from pygeos.io import from_shapely, to_shapely
from shapely.geometry import Point
def test_to_from_shapely():
point = Point(1, 2)
pygeos_point = from_shapely(point)
shapely_point = to_shapely(pygeos_point)
assert shapely_point.x == 1
assert shapely_point.y == 2
with
> return lib.from_shapely(arr, **kwargs)
E TypeError: Expected int for the __geom__ attribute, got LP_GEOSGeom_t
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
python - import shapely failed (win64python3.x) - Stack Overflow
Hello~when I import specific package from shapely, input the follow from shapely.geometry import Point, Polygon from ...
Read more >Error installing shapely via pip on MacOS Big Sur and Python ...
Expected behavior and actual behavior. Would like to see Shapely install on MacOS BigSur and Python 3.9 Steps to reproduce the problem. pip ......
Read more >python - Shapely not installing correctly - GIS Stack Exchange
Every reference I try to make from the library except from shapely import * throws the error WindowsError: [Error 126] The specified module...
Read more >The Shapely User Manual — Shapely 2.0.0 documentation
Returns a string specifying the Geometry Type of the object in accordance with 1. >>> from shapely import Point, LineString ...
Read more >shapely · PyPI
Manipulation and analysis of geometric objects in the Cartesian plane. ... Shapely is a BSD-licensed Python package for manipulation and analysis of planar ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That commit is to fix compat with shapely 2.0, while the current regression is for 1.8.3 (and the 1.8 and 2.0 branches are completely different in shapely)
Yes, thanks to the report. I was just looking into this because it is essentially the same problem as https://github.com/geopandas/geopandas/issues/2531 and https://github.com/shapely/shapely/issues/1485.
This is a regression in 1.8.3, and will be fixed in a quick shapely 1.8.4