public void queryEnvelope(long binId, Envelope envelope) {
    long down = binId / numCols;
    long over = binId % numCols;

    double xmin = extentMin + (over * binSize);
    double xmax = xmin + binSize;
    double ymax = extentMax - (down * binSize);
    double ymin = ymax - binSize;

    envelope.setCoords(xmin, ymin, xmax, ymax);
  }
Gets the envelope for the bin ID.

@param binId
@param envelope
ql/src/java/org/apache/hadoop/hive/ql/udf/esri/BinUtils.java