In this paper, the introduction of porosity into theone-dimensional shallow water equations is investigated to lead to modifiedexpressions for the fluxes and source terms subjected to the effects ofbuildings and other structures. An extra porosity source term appears in themomentum equation. The numerical discretization scheme for shallow waterequations with porosity is presented using finite volume method and Roe-typeapproximate Riemann solver. The source terms of the bed slope and theporosity are both decomposed in the characteristic direction to make thescheme exactly satisfy the conservative property. Several cases have beenbrought, such as the dam break with variable porosity, the steady flowthrough continue porosity and the damming heights in different pier width,to show that the scheme can be used to simulate the influence of buildingsand other structures in the channel with harmonious, robust andhigh-resolution characteristics.