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]: cuspatial.core._column.geocolumn.GeoColumn._from_points_xy has some type issue #888

Closed
thomcom opened this issue Feb 2, 2023 · 3 comments · Fixed by #905
Closed
Assignees
Labels
bug Something isn't working

Comments

@thomcom
Copy link
Contributor

thomcom commented Feb 2, 2023

Version

23.04

On which installation method(s) does this occur?

Rapids-Compose

Describe the issue

This private helper method needs to have some more careful type enumeration taking place. If you create a column using this method from a column of type int64, the resulting column contains all zeros.

Minimum reproducible example

import cupy as cp
import cudf
long = cudf.Series(cp.arange(20))
series = cuspatial.GeoSeries(cuspatial.core._column.geocolumn.GeoColumn._from_points_xy(long._column))
series

Relevant log output

0    POINT (0.00000 0.00000)
1    POINT (0.00000 0.00000)
2    POINT (0.00000 0.00000)
3    POINT (0.00000 0.00000)
4    POINT (0.00000 0.00000)
5    POINT (0.00000 0.00000)
6    POINT (0.00000 0.00000)
7    POINT (0.00000 0.00000)
8    POINT (0.00000 0.00000)
9    POINT (0.00000 0.00000)
dtype: geometry

Environment details

rapids-compose

Other/Misc.

No response

@thomcom thomcom added bug Something isn't working Needs Triage Need team to review and classify labels Feb 2, 2023
@isVoid isVoid self-assigned this Feb 7, 2023
@isVoid
Copy link
Contributor

isVoid commented Feb 7, 2023

I would assume you don't want to construct a coordinate array with integers. We should raise an error if the input is an integer column.

@isVoid isVoid mentioned this issue Feb 7, 2023
3 tasks
@thomcom
Copy link
Contributor Author

thomcom commented Feb 7, 2023

I know that downstream types will be safely converted to the proper type for use with point-in-polygon, I'm not strongly opinionated about this.

@isVoid
Copy link
Contributor

isVoid commented Feb 7, 2023

I admit I don't know enough about coordinate representation in GIS applications. Are there any application/coordinate system/storage system that adopts integer to store coordinates? I know morton code is used as a compression technique in some cases but we don't expose them in user code space. Libgeos uses a precision grid to store coordinates, but representation is still is floating point numbers (?). So I'm not sure about supporting additional dtypes in cuSpatial.

Reducing the number of dtypes supported also reduces the cost of maintenance.

@jarmak-nv @zhangjianting

@rapids-bot rapids-bot bot closed this as completed in #905 Feb 8, 2023
rapids-bot bot pushed a commit that referenced this issue Feb 8, 2023
This PR fixes #888, raises when input is not an integer array.

This PR also fixes a bug in `_from_point_xy` where empty series other than points are incorrectly constructed. An empty linestring array should be properly nested with the leaf column containing 0 elements. Currently it is constructed as a flat array, resulting in a ill-constructed geocolumn.

Authors:
  - Michael Wang (https://github.com/isVoid)

Approvers:
  - H. Thomson Comer (https://github.com/thomcom)

URL: #905
@github-project-automation github-project-automation bot moved this to Done in cuSpatial Feb 8, 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