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

[DISCUSSION] Standardize API inputs with GeoSeries #637

Closed
15 tasks done
isVoid opened this issue Aug 8, 2022 · 9 comments
Closed
15 tasks done

[DISCUSSION] Standardize API inputs with GeoSeries #637

isVoid opened this issue Aug 8, 2022 · 9 comments
Assignees
Labels
improvement Improvement / enhancement to an existing function

Comments

@isVoid
Copy link
Contributor

isVoid commented Aug 8, 2022

Today the python computation API accepts raw structure of arrays input. Such as:

def directed_hausdorff_distance(xs, ys, space_offsets):

and
def point_in_polygon(
test_points_x,
test_points_y,
poly_offsets,
poly_ring_offsets,
poly_points_x,
poly_points_y,
):

The history of this input interface is that cuspatial was used to accelerate specific workflow where developers are very familiar with the underlying data structure of the geometry and used them. General GIS users are not required to know how the data layout before working with GIS functions, and @thomcom and I believe that using GeoSeries as the abstraction layer between user and underlying APIs is important.

cuSpatial's GeoSeries API is implemented based on GeoArrow specification: https://github.com/geopandas/geo-arrow-spec, under the hood it's an arrow UnionArray. This allows GeoSeries represent an array of pure or mixed geometry types. Currently many computation API only supports pure geometry array inputs. This falls within the range where GeoSeries is capable of supporting.

Ideally, the above APIs should look like:

def directed_hausdorff_distance(points: cuspatial.GeoSeries, space_offset: cudf.Series):
def points_in_polygons(points: cuspatial.GeoSeries, polygons: cuspatial.GeoSeries)

TODO:

Distance

Preview Give feedback

Bounding

Preview Give feedback

Filtering

Preview Give feedback

Indexing

Preview Give feedback

Projection

Preview Give feedback

Trajectory

Preview Give feedback

Docs

Preview Give feedback
@isVoid isVoid added bug Something isn't working Needs Triage Need team to review and classify labels Aug 8, 2022
@harrism
Copy link
Member

harrism commented Aug 9, 2022

Ideally, the above APIs should look like:

def directed_hausdorff_distance(points: cuspatial.GeoSeries):

Hmmm, this ignores the spaces in the Hausdorff distance API. This is a directed all-pairs distance computation. So the grouping and order of points matters.

@isVoid
Copy link
Contributor Author

isVoid commented Aug 9, 2022

Edited PR description to address the change.

@harrism
Copy link
Member

harrism commented Aug 9, 2022

I like this direction. API looks much cleaner. As long as we provide factories / converters from other layouts / dataframes.

@thomcom
Copy link
Contributor

thomcom commented Aug 12, 2022

Thanks for creating this discussion. I agree that we should use GeoSeries in any API call that uses coordinates or offsets as much as possible.

@thomcom
Copy link
Contributor

thomcom commented Aug 12, 2022

I propose that we create individual issues for each API that needs to be updated.

@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.

@harrism harrism moved this to In Progress in cuSpatial Oct 24, 2022
@harrism
Copy link
Member

harrism commented Oct 24, 2022

let's convert this to a milestone.

@isVoid
Copy link
Contributor Author

isVoid commented Feb 14, 2023

I propose that we create individual issues for each API that needs to be updated.

Went with this way - this issue is now a meta issue that tracks the progress, where each API is tracked with a sub issue in the task list.

@isVoid isVoid added improvement Improvement / enhancement to an existing function and removed bug Something isn't working labels Feb 14, 2023
@jarmak-nv jarmak-nv removed the Needs Triage Need team to review and classify label Feb 15, 2023
@isVoid isVoid moved this from In Progress to Done in cuSpatial Feb 24, 2023
@isVoid
Copy link
Contributor Author

isVoid commented Feb 24, 2023

This is done.

@isVoid isVoid closed this as completed Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function
Projects
Status: Done
Development

No branches or pull requests

4 participants