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] Support for ST_Distance and ST_contains #231

Closed
2 tasks
jonathanflack opened this issue May 28, 2020 · 12 comments
Closed
2 tasks

[FEA] Support for ST_Distance and ST_contains #231

jonathanflack opened this issue May 28, 2020 · 12 comments
Assignees
Labels
feature request New feature or request
Milestone

Comments

@jonathanflack
Copy link

jonathanflack commented May 28, 2020

We need to quickly calculate the distance between two points in geospatial for high volume network traffic where the geoIP data is known. Additionally looking to reduce result data according to arbitrary selections using standard selections. Optimized for geoPoint would be ideal.

ST_contains for arbitrary lasso, rectangle or circular selections in geospatial. Should return boolean. See OpenGIS Simple Features Implementation Specification for SQL 1.1. s2.1.1.2 // s2.1.13.3 - same as within(geometry B, geometry A)

ST_distance returns the minimum 2D Cartesian (planar) distance between two geometries, in projected units (spatial ref units). See OpenGIS Simple Features Implementation Specification for SQL 1.1.

These are standard geospatial operators, so no alternatives have been considered.

No additional context.

#231 (comment)

@jonathanflack jonathanflack added Needs Triage Need team to review and classify feature request New feature or request labels May 28, 2020
@jonathanflack jonathanflack changed the title We could really use support forr ST_Distance and ST_contains [FEA] We could really use support for ST_Distance and ST_contains [FEA] May 28, 2020
@thomcom
Copy link
Contributor

thomcom commented May 28, 2020

Thanks a lot for filing an issue! I'd love to implement both of these features in the near future. Our team will also be talking about it at our next meeting.

@jonathanflack
Copy link
Author

jonathanflack commented May 28, 2020 via email

@harrism
Copy link
Member

harrism commented May 29, 2020

Hi @jonathanflack, a series of questions:

  1. Is this the ST_Distance you mean? https://postgis.net/docs/ST_Distance.html ST_Contains: https://postgis.net/docs/ST_Distance.html

  2. Are ST_Distance and ST_contains independently useful to you? Or do you need them both before you can start? (This is a prioritization question, so we can split up the work).
    https://postgis.net/docs/ST_Distance.html

  3. For ST_Distance, I see that it supports "geometry" and "geography". Is one more important than the other?

  4. For ST_Contains, there are various geometry combinations to support (we already have parallel point-in-polygon APIs). Do you have specific priorities?

Thanks!
Mark

@cwharris cwharris self-assigned this Jun 3, 2020
@jonathanflack
Copy link
Author

Mark,

  1. Yes
  2. They are indeed independently valuable, but together they amplify each other's usefulness.
  3. I see both as being useful depending on the application.
  4. That's a hard one, but for the purposes of cybersecurity I think being able to bin on standard geopolitical boundaries seems like a good place to start.

J

@cwharris
Copy link
Contributor

Hi, @jonathanflack !

I'm implementing the features you requested, and I need to know how best to expose them for your use cases. I am assuming you want python APIs. Could you write an example of how you might expect to consume this API?

@cwharris cwharris removed their assignment Sep 15, 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
@trenton
Copy link

trenton commented Dec 8, 2021

Is there any ongoing development on this particular feature? It looked like @cwharris got started, but looking through the latest code in core, I didn't see anything. Is this work possibly partially complete on a branch somewhere?

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

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 changed the title We could really use support for ST_Distance and ST_contains [FEA] [FEA] Support for ST_Distance and ST_contains Mar 21, 2022
@harrism harrism changed the title [FEA] Support for ST_Distance and ST_contains [FEA] Support for ST_Distance and ST_contains Mar 21, 2022
@harrism harrism moved this to In Progress in cuSpatial Apr 4, 2022
@harrism
Copy link
Member

harrism commented Apr 4, 2022

@jonathanflack we already have a vectorized Haversine distance API which can calculate geographical point-to-point distances. Is this useful for your ST_distance usage?

@github-actions
Copy link

github-actions bot commented May 5, 2022

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.

rapids-bot bot pushed a commit that referenced this issue May 12, 2022
This PR contributes to #231 , computes distances between pairs of linestrings.

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

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Paul Taylor (https://github.com/trxcllnt)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #510
rapids-bot bot pushed a commit that referenced this issue Jul 29, 2022
…nce` (#558)

Implements 2D point-point L2 distance. Also renamed folder `distances` into `distance`

Contributes to #231

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

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

URL: #558
@jarmak-nv jarmak-nv added this to the ST_Distance milestone Aug 2, 2022
rapids-bot bot pushed a commit that referenced this issue Aug 23, 2022
This PR adds point to linestring distance.

Contributes to #231

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

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

URL: #573
@harrism harrism removed the Needs Triage Need team to review and classify label Aug 24, 2022
rapids-bot bot pushed a commit that referenced this issue Sep 13, 2022
…ython bindings (#660)

This PR adds multi-point and multi-linestring support to `point_linestring_distance`. The c++ API **always** supports multi-variant of the geometry type, since any single-geometry type can be wrapped with a `counting_iteartor` for its underlying geometry offset.

The column API accepts a `std::optional` for the geometry offset inputs. If not provided, they are considered single geometry by default. A `multigeom_dispatcher` is used to generalize the runtime to compile optional information.

This PR also builds python bindings for `point_linestring_distance`. First, the cython bindings is created with a backported `optional` module from cython 3.0 to support the above `std::optional` API. The cython APIs also made use of the dynamic typing property of python to allow geometry offsets to be optional arguments. The python API is the first examplar of a computing API accepting GeoSeries as input. For simplicity, we assume `GeoSeries` only contains single type geometry and there is no mixing of `points` and `multipoints`.

Contributes to #231 
Follow up to #573

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

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

URL: #660
@jarmak-nv
Copy link
Contributor

Closing as we have tracker issues for ST_Distance and a milestone for DE9. Thanks for submitting!

@github-project-automation github-project-automation bot moved this from In Progress to Done in cuSpatial Apr 10, 2023
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
Archived in project
Development

No branches or pull requests

7 participants