BMPs Using SWAT, C#, DotSpatial and SQLite An … Interface for Watershed Evaluating of Agricultural...

Post on 01-May-2018

264 views 9 download

Transcript of BMPs Using SWAT, C#, DotSpatial and SQLite An … Interface for Watershed Evaluating of Agricultural...

An Interface for Watershed Evaluating of Agricultural BMPs Using SWAT, C#, DotSpatial and SQLite

Zhiqiang (Michael) Yuhawklorry@gmail.com

OverviewWhen: 2012Where: South Tobacco Creek watershed near Miami, MBTeam: Watershed Evaluation Group, University of GuelphProject: Watershed Evaluation of Beneficial Management Practices (WEBs), AAFCObjective: Develop an interface to create and evaluate what-if agricultural BMP scenarios to help conservation districts/authorities gain understanding on water quantity and quality effects and allocate limited resources for BMP implementation

Roles and Responsibilities● Design the main architecture and determine required

technologies● Design the GUI and code with C#● Design the interface between GUI and SWAT with the

scenario definition file● Modify SWAT sourced codes to support SQLite results

and scenario definition file

Architecture

GUI(C#, DotSpatial)

SWAT(Fortran, C)

Scenario Definition File

SWAT SQLite Results

Technology - GUI● DotSpatial

o Basic map functionso Feature selectiono Change symbology based on SWAT, economic and

integrated results● MS Chart Control● C#

Technology - Modified SWAT● SQLite C library - Write SWAT results to a

SQLite database● Mix-language compilation with gcc and

gfortran in Eclipse

Highlights● User-friendly GUI with less pop-up windows● Modify SWAT to communicate with GUI● Add SQLite support to SWAT● Modify DotSpatial source codes to generate

given symbology● Change shapefile attributes on-the-fly to

quickly update symbology

Screenshot - Project Tree● A project is consist of several

scenarios and a scenario could have five BMPs

● Project tree is the navigator of the interface. The central view would change as a node is selected.

Screenshot - Project View

A project represents a watershed. It includes the geospatial and model information.

Screenshot - Scenario View

A scenario is a combination of various BMPs including small dams, holding ponds, grazing, tillage and forage conversion. SWAT and economic model could be run for each scenario.

Results could be viewed after the simulation is done.

Screenshot - Small Dam View

Select/deselect small dam on map or from the list on the right to enable/disable them in model

Screenshot - Tillage View, Field Level

Select/deselect fields on map or from the list on the right to apply tillage. Farm level and subbasin level is also supported.

Screenshot - Result View, SWAT Results● Display results with

different colors for polygon and different sizes for point

● Select a feature to view time series in chart at the bottom

● Control result display using the right panel

Screenshot - Result View, Economic Results

Screenshot - Result View, Integrated Results● Cost-effectiveness, i.e.

the amount of reduction (on water, sediment, N or P) per $1000 between two scenarios.

● Most valuable for conservation districts and authorities

Screenshot - Result View, Off-site Integrated Results

Off-side is for the result at the watershed outlet and is good for whole watershed evaluation.