13. Geometries

The main extension of ADQL wrt SQL is addition of geometric functions. Unfortunately, these were not particularly well designed, but if you don’t expect too much, they’ll do their job.

SELECT TOP 500 rv, e_rv, p.radial_velocity,
 p.ra, p.dec, p.pmra, p.pmdec
FROM gaia.dr3lite AS p
JOIN rave.main AS rave
ON 1=CONTAINS(
 POINT(p.ra,p.dec),
 CIRCLE(rave.raj2000, rave.dej2000, 1.5/3600.))

For historical reasons some geometrical functions accept an optional string value as the first argument e.g.

POINT('ICRS',p.raj2000,p.dej2000)
As of ADQL 2.1 this option is marked as deprecated. Many services still only support ADQL 2.0 and hence require this argument.

There are more geometry functions defined in ADQL:

AREA, BOX, CENTROID, CIRCLE, CONTAINS, COORD1, COORD2, COORDSYS, DISTANCE, INTERSECTS, POINT, POLYGON

Problems

(1)

Compare the radial velocities given by the rave.main and arihip.main catalogues, together with the respective identifiers (hipno for arihip, name for rave). Use the POINT and CIRCLE functions to perform this positional crossmatch with, say, a couple of arcsecs.


Markus Demleitner, Hendrik Heinl

Copyright Notice