With significant development of sensors and Internet of things, researchers nowadays can easily know what happens in physical space by acquiring time-varying values of various factors. Essentially, growing data category and size greatly contribute to solve problems happened in physical space. In this paper, we aim to solve a complex problem that affects both cities and villages, i.e., flood. To reduce impacts induced by floods, hydrological factors acquired from physical space and data-driven models in cyber space have been adopted to accurately forecast floods. Considering the significance of modeling attention capability among hydrology factors, we believe extraction of discriminative hydrology factors not only reflect natural rules in physical space, but also optimally model iterations of factors to forecast run-off values in cyber space. Therefore, we propose a novel data-driven model named as STA-LSTM by integrating Long Short-Term Memory (LSTM) structure and spatiotemporal attention module, which is capable of forecasting floods for small- and medium-sized rivers. The proposed spatiotemporal attention module firstly explores spatial relationship between input hydrological factors from different locations and run-off outputs, which assigns time-varying weights to various factors. Afterwards, the proposed attention module allocates temporal-dependent weights to hidden output of each LSTM cell, which describes significance of state output for final forecasting results. Taking Lech and Changhua river basins as cases of physical space, several groups of comparative experiments show that STA-LSTM is capable to optimize complexity of mathematically modeling floods in cyber space.