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

[BUG]: Broken pairwise distance in users.ipynb #902

Closed
thomcom opened this issue Feb 6, 2023 · 0 comments · Fixed by #906
Closed

[BUG]: Broken pairwise distance in users.ipynb #902

thomcom opened this issue Feb 6, 2023 · 0 comments · Fixed by #906
Assignees
Labels
bug Something isn't working

Comments

@thomcom
Copy link
Contributor

thomcom commented Feb 6, 2023

Version

23.04

On which installation method(s) does this occur?

Rapids-Compose

Describe the issue

We decided to change the API for pairwise_linestring_distance in 22.12 (iirc) and drop the six unique arrays in favor of taking two GeoSeries instead.

This breaks the pairwise_linestring_distance example in users.ipynb because that example takes advantage of converting the type of a set of polygons into a set of linestrings, which relied on using the six argument API method for pairwise_linestring_distance.

The solution is to convert the polygon series to a linestring series using the GeoColumn constructor, as below.

x = cuspatial.GeoSeries([
    Polygon([[0, 1], [2, 3], [4, 5]]),
    Polygon([[6, 7], [8, 9], [10, 11]])
])

import cudf
import cupy as cp
y = cuspatial.core._column.geocolumn.GeoColumn(
    (
        cudf.Series(),
        cudf.Series(),
        cudf.Series(x._column.polygons._column.base_children[1]),
        cudf.Series()
    ),
    cuspatial.core._column.geocolumn.GeoMeta({
        "input_types": cp.repeat(cp.array(cuspatial.core._column.geometa.Feature_Enum.LINESTRING.value), len(x)),
        "union_offsets": cp.arange(len(x))
    })
)
geometry = cuspatial.GeoSeries(y)
geometry

Minimum reproducible example

No response

Relevant log output

No response

Environment details

No response

Other/Misc.

No response

@thomcom thomcom added bug Something isn't working Needs Triage Need team to review and classify labels Feb 6, 2023
@github-project-automation github-project-automation bot moved this to Todo in cuSpatial Feb 6, 2023
@isVoid isVoid self-assigned this Feb 7, 2023
@rapids-bot rapids-bot bot closed this as completed in bcf45ef Feb 9, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in cuSpatial Feb 9, 2023
@jarmak-nv jarmak-nv removed the Needs Triage Need team to review and classify label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants