/*
   * (non-Javadoc)
   *
   * @see org.geotools.gce.imagemosaic.jdbc.JDBCAccessBase#getEnvelopeFromResultSet(java.sql.ResultSet)
   */
  @Override
  protected Envelope getEnvelopeFromResultSet(ResultSet r) throws SQLException {
    byte[] bytes = r.getBytes(2);
    WKBReader reader = new WKBReader();
    Geometry bbox = null;

    try {
      bbox = reader.read(bytes);
    } catch (ParseException e) {
      LOGGER.log(Level.SEVERE, e.getMessage(), e);
      throw new SQLException(e.getMessage());
    }

    return bbox.getEnvelopeInternal();
  }
 @Override
 public void parseValue(XmlObject value, MapEposEvent result) {
   Geometry geom;
   try {
     geom = GMLGeometryFactory.parseGeometry(value);
   } catch (ParseException e) {
     logger.warn(e.getMessage(), e);
     return;
   }
   if (geom != null) {
     result.put(MapEposEvent.GEOMETRY_KEY, geom);
   }
 }