Is it possible to calculate if (latitude, longitude) is inside a polygon on CRDB server side?

sql

(Derek Zhang) #1

Suppose we have a table with columns: id, latitude, and longitude.
Is it possible to do the following query?
Given a list of (latitude, longitude) representing a polygon. Use CRDB server-side functions to return the records in the table which are inside the polygon.
I know it can be done for Circle with CRDB functions like SIN, COS, ASIN, ACOS, and RADIANS. But is there a way to support polygon?


(Bob Vawter) #2

CockroachDB does not currently support geospatial indexes. The tracking issue is https://github.com/cockroachdb/cockroach/issues/19313