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

Handle sparse GeoSeries better and add expand_values to convert sparse to dense. #1147

Closed

Conversation

thomcom
Copy link
Contributor

@thomcom thomcom commented May 22, 2023

Fixes #1142

Description

When a GeoSeries is sliced, or through careful construction methods, a sparse GeoSeries can be created:

series = cuspatial.GeoSeries([Point(0, 0)])
sparse_series = series[[0, 0]]
sparse_series
0    POINT (0.00000 0.00000)
0    POINT (0.00000 0.00000)
dtype: geometry

The above series has the appearance of containing two Points, but actually contains a single Point which is indexed twice. pairwise_linestring_intersection depends on a pairwise comparison of dense LineStrings. This PR adds GeoSeries.expand_values() which fills out a sparse GeoSeries prior to calling pairwise_linestring_intersection.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@thomcom thomcom self-assigned this May 22, 2023
@thomcom thomcom requested a review from a team as a code owner May 22, 2023 15:10
@thomcom thomcom requested review from trxcllnt and harrism May 22, 2023 15:10
@github-actions github-actions bot added the Python Related to Python code label May 22, 2023
@thomcom thomcom requested review from isVoid and removed request for trxcllnt May 22, 2023 15:10
@thomcom thomcom added bug Something isn't working 3 - Ready for Review Ready for review by team non-breaking Non-breaking change labels May 22, 2023
@thomcom
Copy link
Contributor Author

thomcom commented May 25, 2023

This PR extends on the functionality in https://github.com/rapidsai/cuspatial/blob/branch-23.06/python/cuspatial/cuspatial/core/geoseries.py#L256 by allowing the features in a sparse mixed geometry column to be expanded. I don't think we need this right now however and am tempted to just close this PR as unneeded. For now, geoseries.lines.column() implements the required functionality.

@thomcom
Copy link
Contributor Author

thomcom commented Jun 22, 2023

Unnecessary.

@thomcom thomcom closed this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working non-breaking Non-breaking change Python Related to Python code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG]: Sliced GeoSeries have invalid ._meta.input_types
1 participant