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

[FEA] Use cudf List types for polygon and polyline geometry #261

Open
trxcllnt opened this issue Aug 6, 2020 · 5 comments
Open

[FEA] Use cudf List types for polygon and polyline geometry #261

trxcllnt opened this issue Aug 6, 2020 · 5 comments
Labels
feature request New feature or request

Comments

@trxcllnt
Copy link
Contributor

trxcllnt commented Aug 6, 2020

Is your feature request related to a problem? Please describe.
With the addition of List and Struct types in cuDF, we can update cuSpatial's polygon and polyline geometry representations to use nested "list of lists of point structures".

Describe the solution you'd like
The logical structure of a list of polygons looks like this:

polygons = [
    [ // <-- polygon 1
        [ // <-- ring 1
            [40, 40], [20, 45], [45, 30], [40, 40] // <-- points
        ]
    ],
    [ // <-- polygon 2
        [ // <-- ring 1
            [20, 35], [10, 30], [10, 10], [30, 5], [45, 20], [20, 35] // <-- points
        ],
        [ // <-- ring 2
            [30, 20], [20, 15], [20, 25], [30, 20] // <-- points
        ]
    ]
]

We can represent these data in the same 4 buffers we use today (poly_offsets, ring_offsets, points_x, points_y) with the following Arrow types:

import pyarrow as pa

polygons = pa.list(pa.field(
  "rings", pa.list(pa.field(
    "points", pa.struct([
      pa.field("x", pa.float32()),
      pa.field("y", pa.float32())
    ])
  ))
))

# The above example's underlying buffers:
# polygon_offsets: [0, 1, 3]
# ring_offsets: [0, 4, 10, 14]
# xs: [40, 20, 45, 40, 20, 10, 10, 30, 45, 20, 30, 20, 20, 30]
# ys: [40, 45, 30, 40, 35, 30, 10, 5, 20, 35, 20, 15, 25, 20]

Additional context
geoarrow/geoarrow#3
geoarrow/geoarrow#4

@trxcllnt trxcllnt added feature request New feature or request Needs Triage Need team to review and classify labels Aug 6, 2020
@harrism harrism removed the Needs Triage Need team to review and classify label Aug 7, 2020
@github-actions
Copy link

This issue has been marked rotten due to no recent activity in the past 90d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

@github-actions
Copy link

This issue has been marked stale due to no recent activity in the past 30d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be marked rotten if there is no activity in the next 60d.

@github-actions github-actions bot added the stale label Feb 16, 2021
@trxcllnt
Copy link
Contributor Author

This should be possible now that we have list and struct types in cuDF.

@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

@jarmak-nv jarmak-nv moved this to Todo in cuSpatial Nov 3, 2022
rapids-bot bot pushed a commit that referenced this issue Feb 27, 2023
…on` (#862)

This PR adds column/python API for `pairwise_linestring_intersection`. Closes #648 

This PR is also the first attempt of #261 , establishing `geometry_column_view` that inherits `cudf::column` and adds additional information to identify the underlying nested levels. Note that it cannot directly inherit from `cudf::lists::list_column_view`, because a point array isn't a `List<T>` array.

Also note that the type codes defined in libcuspatial and cuspatial-python may be different, so there is a type code mapping after computing the result from libcuspaital.

Finally, since `List<Union>` is currently unsupported in libcudf, the python API returns the geometries in two parts: `offset + GeoColumn`.

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

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

URL: #862
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
Status: Todo
Development

No branches or pull requests

3 participants