segasai / q3c

PostgreSQL extension for spatial indexing on a sphere
GNU General Public License v2.0
77 stars 27 forks source link

Feature: Cone intersect with quadrilateral #15

Closed acscott closed 5 years ago

acscott commented 5 years ago

Hi!

Any hints on how to do a cone search against rows containing 4 RA & Dec points defining a quadrilateral?

segasai commented 5 years ago

On May 10, 2019 08:17, acscott notifications@github.com wrote:Hi! Any hints on how to do a cone search against rows containing 4 RA & Dec points defining a quadrilateral?Hi, If you just want to do 4 cone searches around different rows  in a table you can do q3c_join.Sergey

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

acscott commented 5 years ago

Thank you for getting back so quickly! More specifically how to test if a cone intersects a quadrilateral instead of a point. (The quadrilateral defined by the 4 points in each row).

segasai commented 5 years ago

On Fri, 2019-05-10 at 08:59 -0700, acscott wrote:

Thank you for getting back so quickly! More specifically how to test if a cone intersects quadrilateral instead of against a point. (The quadrilateral defined by the 4 points in each row).

I am not sure there is an easy way to do that in SQL that is exact.  In the past when I did that, I usually did the cone search with larger aperture and then double check in python using some geometry package. 

The pgsphere package is one alternative. it has support for geometry operations over various shapes. It may have  a circle overlaps polygon operator... 

acscott commented 5 years ago

Thank you!