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.dr3 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 ADQ 2.1 this option is marked as deprecated. Many services though still run ADQL 2.0 and require this option.

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.dr3 and arihip.main catalogs, 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.


Hendrik Heinl

Copyright Notice