Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames...

44
Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain GIS Conference Pocatello, Idaho
  • date post

    15-Jan-2016
  • Category

    Documents

  • view

    221
  • download

    0

Transcript of Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames...

Page 1: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Going Open Source:Migrating EPA’s BASINS to

MapWindow Open Source GIS

Dr. Daniel P. AmesDepartment of Geosciences, Idaho State University

2005 Intermountain GIS Conference Pocatello, Idaho

Page 2: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Outline

What is BASINS?Why consider open source GIS?What is MapWindow?What is the approach?What are the challenges and

anticipated benefits?

Page 3: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

What is BASINS?

“Better Assessment Science Integrating point and Non-point Sources”

GIS-based watershed modeling and data analysis software

Built by EPA to support watershed approaches such as TMDL

Includes spatial and temporal data for the United States, analysis tools and models

Page 4: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005SETAC GIS & WQ Short Course, 2002

Page 5: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Page 6: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

BASINS 3.1 GIS Interface Ties all software components together through ArcView 3.x and Ties all software components together through ArcView 3.x and extensions.extensions.

Page 7: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

BASINS Spatial Data

• Land use and land cover (shape and grid)

• Urbanized areas

• Populated place locations

• Reach file 1

• Reach file 3

• National Hydrographic Data (NHD)

• Major roads

• USGS hydrologic unit boundaries (accounting and catalog units)

• Drinking water supply sites

• Dam sites

• EPA region boundaries

• State boundaries

• County boundaries

• DEM (shape and grid)

• Ecoregions

• NAQWA study unit boundaries

• Managed area database (Federal and Indian Lands)

• Soil (STATSGO)

Courtesy of Tetra Tech Inc.

Page 8: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

BASINS Utilities and Tools Automatic data downloader and software updater

• Spatial data: NED DEM, NLCD land cover, NHD stream networks.• Temporal data: USGS streamflow, STORET water quality. • Automatic updater for software updates.

Data analysis tools• “Target” to summarize data by watershed in a region• “Assess” to summarize stream quality in a specific watershed• “Data Mining” to link stations to water quality and monitoring records

Watershed delineation tools to identify watershed boundaries and contributing areas• Manual - heads-up digitizing based on elevation polygons• Automatic – raster DEM based algorithms for finding watersheds

Page 9: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Data Extractor

Web-linked tool to set up a new BASINS Project Web-linked tool to set up a new BASINS Project

Page 10: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Downloading BASINS Core DataOnce a watershed HUC is selected, the Once a watershed HUC is selected, the software downloads all of the base GIS and software downloads all of the base GIS and observation data forobservation data forthat watershed.that watershed.

Page 11: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Web Data Download Tool

Additional data can Additional data can be automatically be automatically downloaded from downloaded from various web-sites various web-sites and integrated with and integrated with the base dataset. the base dataset.

Page 12: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Automatic Software Updates

A software updater checks for software A software updater checks for software updates which can include bug fixes as well updates which can include bug fixes as well as new analysis tools as new analysis tools and models. and models.

Page 13: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Multiple Objectives• Source assessment • Receiving water evaluation

Various Scales• Local scale• Watersheds• Basins

Various Levels of Complexity• Screening • Detailed

Courtesy of Tetra Tech Inc.

Models in BASINS

Page 14: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Models in BASINS PLOAD – export coefficient based lumped model

• Steady state, spatial, fit, deterministic.

• “Screening level” model for looking for spatial trends in water quality based on land cover type

SWAT – soil water accounting tool• Dynamic, spatio-temporal, process, deterministic.

• Agriculture-centered watershed model HSPF – hydrologic simulation program FORTRAN

• Dynamic, spatio-temporal, process, deterministic.

• Primarily hydrologic process model with water quality components.

Page 15: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Simple Models in BASINSPLOAD Export Coef. Model

LP = U(LPU * AU)

Where: LP = Pollutant load, lbs;

LPU = Pollutant loading rate for land use type u,

lbs/acre/year; andAU = Area of land use type u, acres

Page 16: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Total pollutant loads by watershed – map and table

Pollutant loads per acre by watershed – map and table

Event Mean Concentration (EMC) by watershed – map and table

PLOAD Output Options

Page 17: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Complex Models in BASINS

MeteorologicalData

GIS

Landuse and pollutantspecific Data

HSPFHSPF

LanduseDistribution

StreamData

Point Sources

Core Model

Post Processing

Windows interface

Landscape dataA

B

D

E

F

C

Courtesy of Tetra Tech Inc.

Page 18: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

BASINS Architecture

GIS-based main user interface• Currently ArcView 3.x

• Spatial data stored as shapefiles

• Temporal data stored in binary “wdm” files All key functions exist in dynamic link libraries

(DLLs) and executables• Tight integration – ArcView extension provides the

GUI and calls functions in a DLL

• Loose integration – ArcView extension prepares input files and launches external executable

Page 19: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

BASINS 4.0

Due Spring 2006 (prime contractor: Aqua Terra Consultants)

Builds off BASINS 3.1 Significant restructuring No third party dependencies or purchase

requirements MapWindow Application and Plug-in

Architecture

Page 20: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Why Open Source GIS?

Original intent of EPA was to provide all software and data freely because it is a federally financed project.

However… No PC-based free or open source GIS alternatives in 1996.

Page 21: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Why Open Source GIS?

Software code licensed under the Mozilla Public License can be used for both commercial and non-commercial applications.

Allows user-developers to access update and improve core GIS and model functionality.

Page 22: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Why Open Source GIS? Increased distribution and

use of BASINS – including internationally.

Since MapWindow was released as open source in January 2005, download bandwidth from www.MapWindow.com has increased from 1 GB per month to about 15 GB per month.

Page 23: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Open Source GIS Options

www.OpenSourceGIS.org lists 189 projects (not MapWindow!!).

www.FreeGIS.org lists 235 projects (yes MapWindow )

Mostly data conversion, reading and writing libraries, specific viewers, web tools and Linux/Unix tools.

Page 24: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.
Page 25: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

What is MapWindow? A “Programmable

Geographic Information System” that supports:• Manipulation and viewing

of GIS data

• Analysis of GIS data and attributes

• Custom GIS modeling

• Custom GIS application development

http://www.MapWindow.com/

Page 26: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Why MapWindow?

We needed a spatial component for our modeling and data analysis projects to support:• Manipulation and editing of spatial data sets• Manipulation and editing of attribute data• Development of custom models using GIS

We couldn’t find a freely distributable GIS that was functional enough to support the functions and types of analysis we needed

So...with help from several funding sources including the Idaho National Laboratory (INL) we built MapWindow

Page 27: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Data DistributionOption 1:

Build a MapWindow Project and distribute it with the free MapWindow GIS application

The MapWindow application is a stand alone software that is freely distributable along with your data

Page 28: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Base MapWindow Functionality

Map area for displaying data Legend and editor for creating custom color schemes for

layers Toolbar and buttons to create, save, and open

MapWindow Project files Toolbar buttons for adding and removing layers from the

map Toolbar button for selecting features Toolbar buttons for navigating the map (zoom in, zoom

out, zoom to a layer, pan, etc.) Toolbar button to Print the current map Preview Map

Page 29: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Custom MapWindow Plug-insDistribute data analysis functionality with your data

•Water Quality Analyst

•Streamflow Analyst

•PhotoViewer

•TIN Builder/Viewer

•Grid Wizard

•Model Manager

•Terrain AnalysisUsing DEMs (TAUDEM)

Page 30: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

For Example: Watershed Information System

VB Plug-in

Plug-in List

Legend

Map Area

MapWindow App

Launch button

Plug-in Functions

Page 31: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Data Distribution Option 2

Use the MapWinGIS ActiveX control to create your own custom tool

The core MapWindow component is a programming object that can be added to a form in Visual Basic or other languages supporting ActiveX

Page 32: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

MapWinGIS ActiveX Control

Open, create, and save geo-referenced image, grid, shapefile, triangular irregular network, and dbf attribute data

View, label, color, highlight, shapefile data on the map Perform spatial queries on the data Search for features with specific attributes Dynamically edit the spatial data and immediately see the

changes in the map Interact with the data through the map Build TINs from Grids, Images from Grids, Shape files

from TINs and Grids, Grids from Shape files, etc.

Page 33: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Watershed Tools at USU “Pre-BASINS”

Nooksack River DSS, WA Virgin River DSS, UT Big Lost River DSS, ID Watershed Information

Systems• Newton Reservoir, UT

• Otter Creek, UT

• Echo Reservoir, UT

• Strawberry Reservoir, UT Others

Page 34: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Open Source MapWindow

ESRIArcView 3.x/9.x

ESRIArcExplorer

Basic GIS Data Vis. Yes Yes Yes

Edit GIS Data Yes Yes No

Create Custom Plug-ins? Yes Yes No

Programming Language VB.NET, C# Avenue/VB None

Free Viewer? Yes No Yes

Developer price Free Free to write extensions, users must purchase ArcView license

N/A

Source Code Available? Yes No No

Plug-in Development Comparison

Page 35: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Open SourceMapWinGIS

ESRIMapObjects LT 2

Blue Marble GeoObjects 3.1

View GIS Data Yes Yes Yes

Edit Attribute Data Yes No No

Edit Spatial Data Yes No No

Includes TIN objects Yes No No

Smooth Redrawing Yes No No

Price Free $1,000

per developer

$999per developer

Royalty Structure None Negotiated $200 per CD or download

Source Code Available?

Yes No No

ActiveX Control Comparison

Page 36: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

The Approach

Customize the MapWindow application interface using

the XML configuration file

Build BASINS functionality as MapWindow plug-ins

Link to external DLL’s and EXE’s as needed (i.e.

models).

Embed MapWinGIS ActiveX in some of these as needed

to provide support maps in specific tools.

Page 37: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

XML Configuration File

Page 38: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

BASINS MapWindow Plug-ins

BASINS plug-ins will include• Project management

• Software updater

• Data downloader

• Data analysis

• Models

All functions that were previously contained in ArcView 3.x extensions

Page 39: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

MapWindow Plug-ins Interface

Page 40: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Challenges

Although BASINS only uses a relatively small number of GIS functions, not all have not been implemented in MapWindow (i.e. clip, mosaic)

Use existing free and open source libraries where possible…• General Polygon Clipper (GPC)

• TAUDEM for watershed delineation

Page 41: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Challenges

Projections – Love ‘em or leave ‘em?• Read and write ESRI .prj files

• Projection libraries – proj4

Data formats – Personal Geodatabase? MrSid? GeoTiff? JPEG2000?• Use other open source and free libraries.

• GDAL

Page 42: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Anticipated Benefits

Finally realize the original goal of EPA in the development and distribution of a fully open and free modeling and data analysis system.

User community will add and share new functions, models, analyses, data viewers, etc.

Page 43: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

Ames – Intermountain GIS 2005

Acknowledgements Paul B. Duda, John L. Kittle, Jr., Mark H. Gray, Paul R. Hummel –

Aqua Terra Consultants

Russell S. Kinerson, Paul Cocca, David Wells, Marjorie Wellman, Ed Partington, Lauren MacWilliams – EPA Office of Science and Technology

Kurt Wolfe – EPA Ecosystems Research Division – Athens, GA

Shane Cherry, Ron Rope – Idaho National Laboratory

David Tarboton, Jeff Horsburgh – Utah State University

Page 44: Going Open Source: Migrating EPA’s BASINS to MapWindow Open Source GIS Dr. Daniel P. Ames Department of Geosciences, Idaho State University 2005 Intermountain.

What’s next?