private static boolean intersects(
      Envelope envelope, Code reqCRS, Envelope[] envs, LonLatEnvelope llEnv)
      throws UnknownCRSException {

    boolean res = false;
    String reqCRSCode = reqCRS.getCode();

    try {
      if (envs == null || envs.length == 0) {
        Envelope latlonEnv =
            GeometryFactory.createEnvelope(
                llEnv.getMin().getX(),
                llEnv.getMin().getY(),
                llEnv.getMax().getX(),
                llEnv.getMax().getY(),
                CRSFactory.create("EPSG:4326"));

        if (!"EPSG:4326".equals(reqCRSCode)) {
          res = intersects(envelope, reqCRSCode, latlonEnv, "EPSG:4326");
        } else {
          res = envelope.intersects(latlonEnv);
        }
      } else {
        for (int i = 0; i < envs.length && !res; i++) {
          if (intersects(
              envelope, reqCRSCode, envs[i], envs[i].getCoordinateSystem().getPrefixedName())) {
            res = true;
            break;
          }
        }
      }
    } catch (GeometryException ex) {
      LOG.logWarning("intersection test; translation into surface failed", ex);
    } catch (CRSException ex) {
      LOG.logWarning(
          "intersection test; transformation of reqeust envelope/valid area impossible", ex);
    } catch (CRSTransformationException ex) {
      LOG.logWarning("intersection test; transformation of reqeust envelope/valid area failed", ex);
    }
    return res;
  }