Vector dataVec = table.getDataVector();
if (rowCoords.isPix()) {
// no WCS, just use image center and size
Point2D.Double p = _coordinateConverter.getImageCenter();
ImageCoords pos = new ImageCoords(p.x, p.y);
double w = _coordinateConverter.getWidth();
double h = _coordinateConverter.getHeight();
double r = Math.sqrt(w * w + h * h);
return new CoordinateRadius(pos, r, w, h);
}
if (!rowCoords.isWCS()) {
return null;
}
// we have world coordinages: find the bounding box of the objects in the table
double ra0 = 0., ra1 = 0., dec0 = 0., dec1 = 0.;
boolean firstTime = true;
for (int row = 1; row < nrows; row++) {
Vector rowVec = (Vector) dataVec.get(row);
Coordinates pos = rowCoords.getCoordinates(rowVec);
if (pos == null) {
continue;
}
if (firstTime) {
firstTime = false;
ra0 = pos.getX();
ra1 = ra0;
dec0 = pos.getY();
dec1 = dec0;
} else {
double ra = pos.getX(), dec = pos.getY();
ra0 = Math.min(ra0, ra);
ra1 = Math.max(ra1, ra);
dec0 = Math.min(dec0, dec);
dec1 = Math.max(dec1, dec);
}