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 5 rv, e_rv,
 p.raj2000, p.dej2000, p.pmRA, p.pmDE
FROM ppmxl.main AS p
JOIN rave.main AS rave
ON 1=CONTAINS(
 POINT(p.raj2000,p.dej2000),
 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