-
Notifications
You must be signed in to change notification settings - Fork 611
Type of x, y and z values of a Point are now numpy.float64 #2070
Copy link
Copy link
Closed
Description
With NumPy's 2.0 release, they've changed the representation of their scalars. This has caused the x, y, and z attribute of a Point to no longe be Python's built-in float type, but NumPy's float64 type instead.
>>> from shapely import Point
>>> point = Point(1, 2)
>>> type(point.x)
<class 'numpy.float64'>However, according to Shapely's documentation of Point, these attributes should be the normal float type instead.
This change caused issues in our project because we were passing a Point's x and y value to our ORM (SQLAlchemy), which was unable to convert a numpy.float64 to a database value.
What is the plan for Shapely going forward? I think it would make sense to have Shapely return Python built-in types, but if you're planning to take the NumPy approach, then the documentation should be updated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels