-
Notifications
You must be signed in to change notification settings - Fork 23
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
add points_from_xy
to GeoSeries
class
#214
base: main
Are you sure you want to change the base?
Conversation
point_from_xy
to GeoSeries
classpoints_from_xy
to GeoSeries
class
@@ -205,6 +205,29 @@ def geoarrow_coords_to_numpy(struct_array: pyarrow.StructArray): | |||
|
|||
raise ValueError() | |||
|
|||
@classmethod | |||
def points_from_xy(cls, x, y, | |||
z: Iterable | pl.Series | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the underlying geo
algorithms support 3-dimensional data at this point, so my inclination was to not try to support 3d coordinates.
@@ -205,6 +205,29 @@ def geoarrow_coords_to_numpy(struct_array: pyarrow.StructArray): | |||
|
|||
raise ValueError() | |||
|
|||
@classmethod | |||
def points_from_xy(cls, x, y, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also want the type hints on x
and y
? Note that Iterable | pl.Series
is a strict subset of what you can pass into pyarrow.StructArray
; it also accepts numpy arrays and pyarrow arrays I think
Thanks for the PR! I'm not exactly sure at a glance why CI is now failing. Regardless I think you might need to apply |
remove z coordinates (unsupported) black formatting of `geoseries.py` add typing for x and y coordinates
Removing z makes things simpler :) |
seems like the pattern is missing |
Parallels function of same name in GeoPandas for creating a GeoSeries from in-memory arrays