cuspatial icon indicating copy to clipboard operation
cuspatial copied to clipboard

Add Point Linestring Distance

Open isVoid opened this issue 2 years ago • 3 comments

This PR adds point to linestring distance.

Contributes to #231

isVoid avatar Jun 16 '22 01:06 isVoid

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Jul 21 '22 08:07 github-actions[bot]

Probably should retarget to 22.10?

harrism avatar Jul 28 '22 02:07 harrism

Will review in the morning.

thomcom avatar Aug 11 '22 02:08 thomcom

points_in_range.cuh hausdorff_test.cu was missing thrust headers and stopped CI. Curious why it was passing compilation before...

isVoid avatar Aug 16 '22 20:08 isVoid

rerun tests

(Seems like the rest of the CI is blocked by the fixes included in this PR)

isVoid avatar Aug 17 '22 01:08 isVoid

The last test failure was results from the incorrect grid-stride loop guard condition. The last point of the last linestring point array should not be accessed since each iteration handles one line-segment. Thus the guard condition should be:

idx < std::distance(linestring_points_first, thrust::prev(linestring_points_last));

The skip condition in the loop is also missing a check on OB iterator. And should skip iteration to next grid-stride instead of just returning. (The length of each linestring does not correlate with grid-stride).

if (offsets_iter != linestring_offsets_last and *offsets_iter - 1 == idx) { continue; }

isVoid avatar Aug 17 '22 18:08 isVoid

@thomcom I believe I have added the geoarrow point array format and offset array format support per your review above. The good news is I almost didn't have to touch the kernel at all. To your question:

I'm interested to find out in this if it works without modification.

The answer is positive.

One last thing that's missing from making this fully geoarrow compliant is supporting multi-linestring and multi-point. Since that's a pretty big change to the code, after a second thought, I'm planning to submit it as a separate PR.

Other than this I believe there's an open question for docstrings. If you agree, can we punt the question to later PR and proceed with this one?

isVoid avatar Aug 19 '22 00:08 isVoid

@gpucibot merge

isVoid avatar Aug 23 '22 03:08 isVoid

Thanks to all reviewers, a draft follow up PR is up as promised: https://github.com/rapidsai/cuspatial/pull/660

isVoid avatar Aug 23 '22 03:08 isVoid