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

Vectorized points_from_xy? #1

Closed
ljwolf opened this issue Jul 27, 2020 · 1 comment
Closed

Vectorized points_from_xy? #1

ljwolf opened this issue Jul 27, 2020 · 1 comment

Comments

@ljwolf
Copy link

ljwolf commented Jul 27, 2020

Watching these updates roll in is very exciting :)

I wanted to just make a minor suggestion: the geopandas.points_from_xy can be significantly more efficient than the list comprehension + shapely.geometry.Point() strategy used here.

XYs = gpd.GeoDataFrame({'geometry': [Point(xy) for xy in XYs]} )

This is mainly because of efficiency gains made using pygeos, which vectorizes the creation of the points. I'd use this wherever you're casting from arrays to geopandas.Geo* containers.

@SamComber
Copy link
Owner

Thanks and great suggestion, I wasn't aware of this! I can see the performance gains are made from geopandas here conditional on pygeos being installed.

Will apply this in the next push. As ever, your feedback and review is always welcome.

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

No branches or pull requests

2 participants