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

add points_from_xy to GeoSeries class #214

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tsutterley
Copy link

Parallels function of same name in GeoPandas for creating a GeoSeries from in-memory arrays

@tsutterley tsutterley changed the title add point_from_xy to GeoSeries class add points_from_xy to GeoSeries class Mar 21, 2023
@@ -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,
Copy link
Member

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,
Copy link
Member

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

@kylebarron
Copy link
Member

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 black

remove z coordinates (unsupported)
black formatting of `geoseries.py`
add typing for x and y coordinates
@tsutterley
Copy link
Author

Removing z makes things simpler :)
applied black formatting so we'll see how it goes with CI
happy to contribute!

@tsutterley
Copy link
Author

RuntimeError: The Poetry configuration is invalid:
 - [extras.pipfile_deprecated_finder.2] 'pip-shims<=0.3.4' does not match '^[a-zA-Z-_.0-9]+$'

seems like the pattern is missing <=?

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

Successfully merging this pull request may close these issues.

None yet

2 participants