rapidsai / cuspatial

CUDA-accelerated GIS and spatiotemporal algorithms
https://docs.rapids.ai/api/cuspatial/stable/
Apache License 2.0
585 stars 148 forks source link

[FEA] Support for ST_Distance and ST_contains #231

Closed jonathanflack closed 1 year ago

jonathanflack commented 4 years ago

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.

https://github.com/rapidsai/cuspatial/issues/231#tasklist-block-1c9f6f44-5086-4546-87bc-064bcee1b229

thomcom commented 4 years ago

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 commented 4 years ago

Thanks! This is very important for us in cyber, as we pivot a lot of analysis around geo dimensions. This would help accelerate that workflow dramatically, as well as any inference based on analytic results based on this refinement. It also offers an opportunity to potentially enrich network data with geospatial attributes at line rate for us during ETL.

Jonathan Flack, Principal Systems Architect BROADBRIDGE NETWORKS www.broadbridgenetworks.com • jf@broadbridgenetworks.net [m] +1 310-359-3510

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, May 28, 2020 1:01 PM, H. Thomson Comer notifications@github.com wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

harrism commented 4 years ago

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

jonathanflack commented 4 years ago

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 commented 4 years ago

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?

github-actions[bot] commented 3 years ago

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[bot] commented 3 years ago

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.

trenton commented 2 years ago

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[bot] commented 2 years ago

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 commented 2 years ago

@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[bot] commented 2 years ago

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.

jarmak-nv commented 1 year ago

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