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

Refactor ST_Distance Column API and Cython #1124

Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7d22d0f
initial move
isVoid Apr 27, 2023
ccace6c
style
isVoid Apr 27, 2023
1daff2d
Reorganize src, tests, and benchmarks
harrism May 3, 2023
b2b30a6
docs
harrism May 3, 2023
10bf00c
Combine missed polygon_distance.hpp
harrism May 3, 2023
ea28304
pragma once and copyrights
harrism May 3, 2023
23fe07e
Fix distance include.
harrism May 3, 2023
2675106
Merge branch 'branch-23.06' of https://github.com/rapidsai/cuspatial …
isVoid May 3, 2023
aaa79c6
Merge remote-tracking branch 'harrism/feature/reorganize-src-tests-be…
isVoid May 3, 2023
5ef4a61
Merge branch 'improvement/move_linestring_polygon_distance' into impr…
isVoid May 3, 2023
2a6fa4e
Updates geometry fixture and use it with linestring_polygon distance …
isVoid May 3, 2023
2916ace
refactor pairwise_point_distance
isVoid May 3, 2023
c259811
update point_distance cpp test
isVoid May 3, 2023
1640e45
refactors point linestring distance
isVoid May 3, 2023
757f1a3
refactors linestring_distance
isVoid May 4, 2023
0e6d473
homogenize documentation
isVoid May 4, 2023
4ea73c3
refactor cython
isVoid May 4, 2023
72eee7b
remove unused dependencies
isVoid May 4, 2023
8c2e14f
Merge branch 'branch-23.06' of https://github.com/rapidsai/cuspatial …
isVoid May 4, 2023
d6861ea
python API refactor
isVoid May 4, 2023
e4276c5
assertion checks
isVoid May 4, 2023
ad623b3
fix linestring_distance empty input bug
isVoid May 4, 2023
588d309
fix invalid address access
isVoid May 4, 2023
609d308
remove unused headers
isVoid May 4, 2023
7e40575
style
isVoid May 4, 2023
6bbf470
address review comments
isVoid May 9, 2023
fd8cfa8
Merge branch 'branch-23.06' into improvement/standardizing_st_distanc…
isVoid May 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
homogenize documentation
isVoid committed May 4, 2023
commit 0e6d4733b4329f2228b97975b77d82a8943254ae
36 changes: 20 additions & 16 deletions cpp/include/cuspatial/distance.hpp
Original file line number Diff line number Diff line change
@@ -184,8 +184,7 @@ std::unique_ptr<cudf::column> pairwise_point_linestring_distance(
* @throw cuspatial::logic_error if `multipoints` and `multipolygons` sizes differ
* @throw cuspatial::logic_error if `multipoints` is not a point column and `multipolygons` is not a
* polygon column.
* @throw cuspatial::logic_error if `multipoints` and `multipolygons` has different coordinate
* types.
* @throw cuspatial::logic_error if `multipoints` and `multipolygons` coordinate types differ
*/

std::unique_ptr<cudf::column> pairwise_point_polygon_distance(
@@ -208,50 +207,55 @@ std::unique_ptr<cudf::column> pairwise_point_polygon_distance(
* @throw cuspatial::logic_error if `multilinestrings1` and `multilinestrings2` sizes differ
* @throw cuspatial::logic_error if either `multilinestrings1` or `multilinestrings2` is not a
* linestring column.
* @throw cuspatial::logic_error if `multipoints` and `multipolygons` has different coordinate
* types.
* @throw cuspatial::logic_error if `multilinestrings1` and `multilinestrings2` coordinate types
*/
std::unique_ptr<cudf::column> pairwise_linestring_distance(
geometry_column_view const& multilinestrings1,
geometry_column_view const& multilinestrings2,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Compute pairwise (multi)linestring-to-(multi)polygon Cartesian distance
* @brief Compute pairwise (multi)linestring-to-(multi)polygon Euclidean distance
*
* The distance between a pair of (multi)linestring and (multipolygon) is the shortest Euclidean
* distance between any pair of segments in the multilinestring and edges in the multipolygon. If
* any of the segments intersects, or if any linestring is contained in any polygon, the distance is
* 0.
*
* @param multilinestrings Geometry column of multilinestrings
* @param multipolygons Geometry column of multipolygons
* @param mr Device memory resource used to allocate the returned column.
* @return Column of distances between each pair of input geometries, same type as input coordinate
* types.
*
* @throw cuspatial::logic_error if `multilinestrings` and `multipolygons` have different coordinate
* types.
* @throw cuspatial::logic_error if `multilinestrings` is not a linestring column and
* @throw cuspatial::logic_error if `multilinestrings` and `multipolygons` sizes differ
* @throw cuspatial::logic_error if either `multilinestrings` is not a linestrings column or
* `multipolygons` is not a polygon column.
* @throw cuspatial::logic_error if input column sizes mismatch.
* @throw cuspatial::logic_error if `multilinestrings` and `multipolygons` has different coordinate
* types.
*/

std::unique_ptr<cudf::column> pairwise_linestring_polygon_distance(
geometry_column_view const& multilinestrings,
geometry_column_view const& multipolygons,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**
* @brief Compute pairwise (multi)polygon-to-(multi)polygon Cartesian distance
* @brief Compute pairwise (multi)polygon-to-(multi)polygon Euclidean distance
*
* Computes the cartesian distance between each pair of the multipolygons.
* The distance between a pair of (multi)polygon and (multi)polygon is the shortest Euclidean
* distance between any pair of edges in the multipolygons. If any edges intersects, or if any
* polygon is contained in any other polygon, the distance is 0.
*
* @param lhs Geometry column of the multipolygons to compute distance from
* @param rhs Geometry column of the multipolygons to compute distance to
* @param multipolygons1 Geometry column of the multipolygons to compute distance from
* @param multipolygons2 Geometry column of the multipolygons to compute distance to
* @param mr Device memory resource used to allocate the returned column.
*
* @return Column of distances between each pair of input geometries, same type as input coordinate
* types.
*/
std::unique_ptr<cudf::column> pairwise_polygon_distance(
geometry_column_view const& lhs,
geometry_column_view const& rhs,
geometry_column_view const& multipolygons1,
geometry_column_view const& multipolygons2,
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

/**