<<

Sizing Stream Setback Using GIS Tools for Stream Protection

THESIS

Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University

By

Ming Sheng

Graduate Program in Environmental Science

The Ohio State University

2012

Master's Examination Committee:

Dr. Steven Gordon, Advisor

Dr. Maria Conroy

Dr. Andrew Ward

Copyrighted by

Ming Sheng

2012

Abstract

Administering stream setback ordinances is widely adopted by local governments to maintain the health and integrity of stream systems. A setback is a designated zone within a floodplain where land development that would have negative impact on the stream is strictly prohibited. Given the fact that Geographic Information System (GIS) has been pervasive in support of resources planning and management in many aspects, this study examines the uses of ArcGIS geoprocessing tools in designing properly sized stream setbacks for the Big Darby Creek Watershed. A streamway formula that relies on the drainage area as the single independent variable is applied for setback width calculation.

A workflow and various python script modules are developed to implement the operating framework where drainage network is first classified based on stream order and then individual reaches undergo further division based on a user-specified criterion. The recommended criterion requires that the computed setback width difference between the upstream and downstream end of each divided segment be no greater than 10%. The feasibility of implementing the setback widths resulting from the program is evaluated against the existing land uses along the riparian corridors in this watershed. The findings suggest that the designed setback widths are generally practical without severely conflicting with the current land uses. The developed workflow and GIS tool package

ii can benefit localities having interest in stream protection, and be applied to any streams in the eastern U.S.

iii

Dedicated to my husband,

Zeng Zhang

iv

Acknowledgments

I am indebted to my advisor, Dr. Steven Gordon, who has been supporting and leading my work throughout my graduate experience. Without his guidance on this project as well as the financial support provided, I would not have the freedom to dive into the amazing world of GIS and Python. I would like to thank my committee members Dr.

Ward for the discussion about the stream morphology principles, and Dr. Conroy for her gracious willingness to serve on the committee on short notice.

My special thanks go to Dean Djokic and Christine Dartiguenave from ESRI water resources team for their patience in helping me troubleshoot the problems with ArcHydro geoprocessing tools. Also, I would like to express my deepest gratitude to Dr. David R.

Maidment from University of Texas at Austin and Dr. Laura Tateosian from North

Carolina State University. They generously share their courses online--GIS in Water

Resources and GIS Programming Fundamentals respectively, both of which enabled me to grasp the necessary skills to complete this work.

Most importantly, I would like to thank my husband Zeng Zhang who always has faith in me, encouraging me and inspiring me. From him, I know what are determination, dedication, and persistence. Without him, I would not have come to where I am today and moreover, would not have become a huge Buckeye fan. I also owe my thanks to my

v dear family 8,000 miles away who have always valued knowledge and education and always been by my side regardless of how far apart we are physically.

Lastly, I want to thank ESGP for all the support during my study here at The Ohio State

University. Especially I thank Maurea Al-khouri for her kind administrative assistances which make the “Ship of Graduation” on the right track towards its destination.

vi

Vita

June 2002 ...... Changzhou High School

2006...... B.Eng. Environmental Engineering,

Nanjing University

2007...... M.S. Environmental Science & Engineering,

Nanyang Technological University

2007 to 2009 ...... Engineer, Public Utility Board (PUB)

2010 to present ...... Graduate Research Associate,

Environmental Science Graduate Program,

The Ohio State University

Fields of Study

Major Field: Environmental Science

vii

Table of Contents

Abstract ...... ii

Acknowledgments...... v

Vita ...... vii

List of Tables ...... x

List of Figures ...... xi

Chapter 1: Introduction ...... 1

1.1 Overview ...... 1

1.2 Overview of Setback Regulations ...... 2

1.3Types of setbacks and their scientific bases ...... 5

1.3.1 Riparian Buffer ...... 5

1.3.2 Streamway Concept ...... 8

1.4 Research Objective ...... 14

Chapter 2: Implementation Methodology ...... 16

2.1 Data and Software ...... 16

2.2 Workflow and Scripts...... 19 viii

2.2.1 Terrain Preprocessing ...... 22

2.2.2 Breakpoint Identification ...... 27

2.2.3 Setback Mapping ...... 32

Chapter 3: Results and Discussion ...... 34

3.1 Setback Width Distribution ...... 34

3.2 Current Land Use ...... 44

Chapter 4: Conclusion...... 49

References ...... 53

Appendix A: Sizing Setback Tools User Manual ...... 56

Appendix B: Python Scripts...... 68

ix

List of Tables

Table 1: Acreage of different land covers in the setback riparian zone ...... 44

x

List of Figures

Figure 1: Illustration of a 25ft riparian buffer applied to both sides of a stream (Mathews

2006) ...... 6

Figure 2: Buffer zones along one side of the stream (Wet Weather Solution Program),

Kansas City MO ...... 6

Figure 3: Illustration of an 82ft setback designed using streamway concept (Mathews

2006) ...... 12

Figure 4: Location of the Big Darby Creek Watershed ...... 17

Figure 5: Customized toolset "Sizing Setback" storing script tools in the ArcToolbox ... 19

Figure 6: Stream order classification ...... 21

Figure 7: A sample stream reach constructed by segments and vertices ...... 22

Figure 8: Terrain Preprocessing Workflow ...... 23

Figure 9: Flow direction coding (Olivera et al. 2002). Each number is a code representing a direction...... 25

Figure 10: Physical representation of flow direction grid and flow accumulation grid

(Olivera et al. 2002) ...... 25

Figure 11: Comparison between stream polyline layer downloaded from NHD (left) and the drainage line generated by the terrain preprocessing using the default threshold (right)

...... 26 xi

Figure 12: Stream Order Classification Workflow ...... 28

Figure 13: Illustration of endpoint modification for lower order streams. Pn is the last vertex by default and Pn-1 is the vertex before the last, and P is the actual drainage point used for watershed delineation ...... 30

Figure 14: The 2nd order stream reach used to test All-vertices Delineation Method

(highlighted in blue) ...... 31

Figure 15: Stream setback mapping for the Big Darby Creek Watershed ...... 36

Figure 16: Processing time when using different criteria as input...... 37

Figure 17: Setback width distribution in each county ...... 40

Figure 18: Composition of different land covers in riparian corridors of all the six counties (%) ...... 46

Figure 19: ArcHydro Toolbox (left) and ArcHydro Toolbar (right) ...... 58

Figure 20: Stream Order Classification Tool ...... 59

Figure 21: Merge Connected Stream Segments Tool ...... 59

Figure 22: Final All Vertices Tool ...... 61

Figure 23: Search Breakpoints Tool ...... 62

Figure 24: Search Breakpoints Batch Mode Tool...... 63

Figure 25: Split Stream at Vertices Tool ...... 64

Figure 26: Associate Setback Width to Stream Tool ...... 65

Figure 27: Batch Stream Split and Setback Match Tool ...... 65

Figure 28: Merge Setback Width Tool ...... 66

Figure 29: Clear Workspace Tool ...... 67

xii

Chapter 1: Introduction

1.1 Overview

Streams are an essential component of ecosystems and play an important role in the hydrologic cycle. Local governments have been implementing a variety of stream protection programs for decades to ensure the health and integrity of stream systems.

Stream setback is one of the many common practices, often incorporated into land development standards or local zoning codes in the form of a stream setback ordinance.

This study will look into the challenges in administering a stream setback program, focused on the sizing issue that most often confronts localities. Given the fact that

Geographic Information System (GIS) has become pervasive in supporting stormwater management and land use planning, this study will specifically explore the potential of creating workflows and script tools in ArcGIS to facilitate the design of setback width on a watershed scale. The ultimate goal is to develop automatic tools which can be incorporated into standard management procedures and can further enhance the capability of GIS software in zoning and watershed management.

The rest of this chapter reviews the existing setback regulations that have been put in place by various authorities, and discusses their underlying principles by reviewing scientific literature. Chapter 2 proposes an operating framework to implement one of the 1 setback design approaches in ArcGIS. Detailed description of workflows and implementation methods are also given in a chronologic sequence. Chapter 3 discusses the results of the GIS computation and the implications for future policy making, while conclusions are drawn in Chapter 4. A user manual of the customized tools and detailed scripts are provided in Appendix A and B respectively.

1.2 Overview of Setback Regulations

The notion that the health and quality of a stream is very much dependent on the lands adjacent to it (Wenger and Fowler 2000) has led to large number of studies and regulations that center on those areas.

Stream setback ordinances are also referred to as riparian buffer ordinances by some governing entities. Stream setback defines the zone within a floodplain where land uses and developments that would impair the functionality of these areas are strictly regulated

(NOACA 2009). Floodplain and riparian zone are terms commonly found in the scientific literature and related regulations. Although they both refer to areas close to a stream, they are often used in different contexts. A floodplain is an area adjacent to a stream that is inundated when a stream flood occurs. For a given stream, the extent of a floodplain depends largely on the magnitude of a flood event being considered and is characterized by the return period of a flood. For example, a 100-year floodplain encompasses the area next to a stream channel that is inundated by a 100-year flood (i.e.

1% chance of occurrence in any one year). If the adjacent area is experiencing periodic flooding (i.e. more than once every year), it is often called “active floodplain” (Ward et al. 2009). On the other hand, when the term “riparian zone” is used, it does not have to be

2 associated with any flood event. Its basic meaning is land adjoining a waterbody (Wenger and Fowler 2000) that is often well vegetated.

Typical activities and structures prohibited in a stream setback include: building construction, impervious surfaces, logging roads, mining, septic tank drainage fields and so on (Wenger and Fowler 2000). By setting a stream setback with a proper size, not only would a variety of ecological functions of riparian zones be maintained (e.g. sediment interception, pollutant removal, flood attenuation, etc.) , but a lot of other benefits can also be achieved, including minimizing property damage, protecting property values, avoiding downstream liability (NOACA 2009), and limiting the need for costly structural measures that would otherwise be required for flood control (Mathews 2006).

Although the necessity and significance of establishing stream setbacks or riparian buffers have been widely acknowledged, what can be considered a “properly sized” setback remains a point of discussion. U.S. Environmental Protection Agency (U.S.

EPA)’s review of current riparian buffer guidelines indicates that the federal legislations have not established a comprehensive statutory law regarding riparian buffers, but rather have suggested using them as a tool to reduce nutrient load with recommended buffer widths ranging from 7 to 100 meters (Mayer et al. 2005). Similarly, many states require counties, municipalities, and districts to protect floodplains or riparian corridors but they don’t mandate any specific guidelines, only providing a minimum buffer requirement or a broad setback recommendation. Often times, local governing bodies that have the authority to develop and administer setback ordinances will find either the state-specified minimum buffer width too small to achieve their management goals (Wenger and Fowler

2000) or the general standards almost impractical to follow. To make scientifically based 3 information available and provide technical assistance to local officials, some watershed groups, regional agencies, and research institutes have developed model ordinances by synthesizing information gathered from scientific literature. Examples are model ordinances developed by Chagrin Watershed Partners (CRWP) (Schwartz 2006),

Mid-America Regional Council (MARC), and Carl Vinson Institute of Government

(Wenger and Fowler 2000). By reviewing these model ordinances as well as guidelines developed by state resource agencies and localities e.g. Ohio Department of Natural

Resources (ODNR) (Mathews 2006), Franklin County OH (Franklin County Board of

Commissioners 2008, 650), Independence City MO (Patti Banks Associates and Applied

Ecological Services 2006), Kansas City MO (Wet Weather Solutions Program), it is found that setback ordinances vary from region to region, often developed based upon different principles and scientific grounds.

Nevertheless, by and large there are two fundamental ecology concepts that bring about two distinct setback design approaches, namely riparian buffer and streamway concept respectively. The riparian buffer is a strip zone extended from the bank of each side of a river channel, while the streamway defines a zone in which a stream channel meanders.

Because of this, a 100ft-buffer means the distance measured from the bank of one side of the channel to the outer boundary of the buffer zone is 100ft (total width will be 200ft plus the channel width) , whereas a 100ft streamway setback refers to the total width encompassing the channel. The major difference between these two design concepts lies in the fact that the riparian buffer is normally used to achieve biological and ecological goals centered on water quality and habitat suitability, while the streamway setback is specifically looking at the natural stream processes from a morphological point of view 4 and aims to help streams self-sustain. Details about these two types of setback are provided in the following sections.

1.3Types of setbacks and their scientific bases

1.3.1 Riparian Buffer

The term “Riparian Buffer” is most commonly used in local zoning regulations that deal with stream protection, indicating the prevalence of the “buffer” concept among local governing entities having interest in protecting the stream quality. As its name suggests, a riparian buffer refers to “an undisturbed naturally vegetated strip of land that lies along”

(p.5) water bodies such as streams, or lakes (Wenger and Fowler 2000). Studies over the last three decades have shown that these well-vegetated corridors can serve as a

“buffer belt” to keep a stream from anthropogenic disturbances. The well-known buffer effects they can offer include intercepting nutrients and sediments, stabilizing stream banks, moderating stream temperature, and providing ideal habitat for aquatic and terrestrial wildlife species, etc. (Lee et al. 2004, Wenger and Fowler 2000). Ordinances developed using this concept often require a buffer of a certain width to be applied on both sides of a stream, extending from the edge of the active stream channel (Figure 1).

Typically, the designated buffer area along each side will also be divided into three zones, as illustrated by Figure 2, each having a specified width and land use restrictions.

5

Figure 1: Illustration of a 25ft riparian buffer applied to both sides of a stream (Mathews 2006)

Figure 2: Buffer zones along one side of the stream (Wet Weather Solution Program), Kansas City MO

The required width of a buffer zone is at each locality’s discretion, but in most cases it is determined in accordance with the minimum width recommended by researchers who studied and established the correlations between the necessary width of a buffer and its effectiveness in performing various functions. For instance, Wenger (Wenger 1999) pointed out in his review that a buffer of 100ft (30m) would be wide enough for long- term sediment control. Bank stabilization can be sufficiently maintained by a relatively thin (<20m) buffer as demonstrated by a number of researchers (Walter et al. 2009). For 6 streams where a large number of aquatic species exist (e.g. fish, amphibians), a buffer zone of 25-200ft should be designed to protect the aquatic habitat (Rabeni, 1991; cited by

Ward et al. 2002).

This approach simply relies on investigations of individual ecological services. Although it provides a general guideline, it poses challenges to policy makers as illustrated below:

1) The various riparian buffer functions are interdependent (Schwartz 2006),

attributed to the interactive processes present in a riparian ecosystem. Very often,

stream preservation or stormwater management teams will have to achieve

multiple goals and therefore can hardly find useful the recommendations based

upon isolated probes into different ecological services.

2) The results of these scientific studies are largely dependent on site-specific

factors, making most scientists very conservative about the generalization of their

findings. That accounts for the fact that many width recommendations just

provide a range and sometimes even have a large variance. Ideally, as pointed out

by Wenger and Fowler (2000), in order to determine the correct width, localities

should use the recommended range as a reference while conducting additional

research in the area of their jurisdiction. But in practice, these studies are often

costly and time-consuming, which gives an extra burden to localities and makes

the studies almost impossible to be conducted (Wenger and Fowler 2000).

Despite the challenges, the “buffer” approach has been widely adopted, probably due to the relatively long history of research and the availability of existing model ordinances.

7 Albeit that the buffer regulation exhibits greatly variance across local governments, it usually takes two forms: fixed-width buffer and variable width buffer.

A fixed-width buffer, as its name suggested, is a buffer zone of a certain width uniformly applied along a water body, regardless of the topographic features, drainage characteristics, or the other site-specific considerations. Fixed-width buffers are most likely the easiest to be administered, but are criticized as less scientifically defensible and exert a point of debate (Wenger and Fowler 2000). A fixed-width may at some point provide insufficient protection, while under other circumstances infringes landowners’ property rights because of over-protection (Wenger and Fowler 2000).

In contrast, the variable-width option would overcome the aforementioned drawbacks, but apparently takes a lot more effort to administer, with many more technical issues to be addressed and being less straightforward for the public to understand (Wenger and

Fowler 2000). Under certain circumstances, it may even cause the perception of unfairness among landowners whose properties are designated with wider setbacks

(Wenger and Fowler 2000). The variable-width buffer formula is normally constructed by using a baseline width modified by some site-specific factors. It was suggested by

Wenger and Fowler (2000) that modifying factors such as slope, existence of wetlands and impervious surfaces, and the extent of floodplain should be considered (Wenger and

Fowler 2000). In a quantitative review of riparian buffer width guidelines associated with timber harvesting in North America (Lee et al. 2004), the researchers reported that “water body type, water body size, slope, presence of fish, and selective harvest”(p.167) are the modifying factors most commonly used by jurisdictions surveyed.

1.3.2 Streamway Concept 8 Unlike many of the government and resource agencies who implement setback ordinances based on a riparian buffer paradigm, the ODNR proposed a new setback design criteria in the 3rd edition of Rainwater and Land Development Manual (Mathews

2006). This approach, deeply rooted in stream , is focused on “natural stream processes” rather than isolated riparian ecosystem functions. Designing a setback using this framework assumes that the overall integrity and health of a stream system can be achieved only when the natural stream processes are undisturbed (Mathews 2006). As a matter of fact, a properly sized setback should be able to cover the most critical area where those stream processes can freely occur (Mathews 2006).

This emerging setback design criteria finds its origin in the dynamic equilibrium theory of streams (Rosgen 1994) and the streamway concept introduced by Ward et al. (2002).

According to stream geomorphology theories, a stream, as long as it is well connected to its original floodplain, will be able to self-maintain its stability. The fact that a stream is stable does not mean its morphologic characteristics (i.e. dimension, profile and pattern) are invariant. In fact, natural streams often progressively undergo a series of channel adjustments resulting from magnitude and temporal variations of stream flow, direct disturbance, as well as changes in sediment supply and vegetation (Rosgen 1994). Yet, no matter what kind of adjustments take place, natural streams (i.e. streams with minimum human-imposed disturbances and well attached to its floodplain) always tend to achieve a state of dynamic equilibrium (Ward et al. 2009).

Lane (1955) provided a classic description about the stream channel stability by using the following equation (Ward and Trimble 2004):

Qsd α QS (1) 9 where Qs is the sediment , d is the median sediment size, Q is the discharge and

S is the bed slope. The product of Qs and d is a surrogate of the discharge of bed material sediment, whereas the product of Q and S is indicative of stream power. The equation suggests that the greater the stream power is, (i.e. greater discharge and steeper slope) the larger shear stress the flowing water exerts on the bed and banks of stream channels. If the stream power exceeds the resistance of channel materials, the sediments will be moved downstream causing scour of the bed and banks, and the stream channel will then be degraded (Ward et al. 2009). Therefore, in order for streams to achieve the equilibrium between stream power and sediment movement, the excessive flow needs to be spilled onto the floodplain, taking advantage of the infiltration process and thus only the bankfull or effective discharge can be contained in the main channel. By this means, the floodplain acts as a good sink to assimilate the additional energy and helps the stream power stay within normal threshold to prevent channel scouring (Ward et al. 2009).

In places where stream channels or floodplains are altered for the purpose of increasing the channel conveyance to control floods or land development such as residential building or parking lot construction etc., the stability or dynamic equilibrium of streams is most likely disrupted. The excessive stream power that cannot be dissipated by floodplains will force channels to downcut, making them detached from the original floodplains. Ultimately, the incised channels have to slowly establish new floodplains but at a lower elevation so as to revert to the state of equilibrium (Ward et al. 2009).

In that regard, Ward et al. (2002) proposed the “streamway” concept, which defines a zone within an active floodplain that can provide enough space for the main channel to

10 self-adjust its meander pattern and to sustain dynamic equilibrium. They indicated that if a streamway setback is properly sized, within which a “stream rules” or is “allowed to run wild”, “it should not be of concern if the main channel encroaches on or floods activities within this zone” (p.4). They derived a streamway width formula (Equation 2) from William’s empirical equation (1986) which relates meander beltwidth with the bankfull width, and further correlated bankfull width to drainage area based on the regional curve for rivers in the eastern USA

0.43 Sw = 120 DA (2)

Where DA- Drainage area (sq.mi.)

Sw- Streamway width (ft)

The formula was tested on six stream reaches in Ohio. Their findings showed evidence that the formula could give reasonable estimation on the floodplain width necessary to allow for streams’ “self-adjusting”.

This empirical formula exhibits great merit in establishing scientifically-defensible regulatory tools for stream and floodplain protection. It embodies the sophisticated theory of stream morphology and dynamic equilibrium with a single variable (i.e. drainage area), and hence can be readily incorporated into zoning regulations and management practices. Nonetheless, it has not gained the same popularity as the riparian buffer approach did, with only a couple of government entities mention it in their zoning ordinances or land development manuals. The possible reasons for this are listed below:

11 1) This approach has not been studied as long as its counterpart. Decision- makers

are usually hesitant to move forward when adequate scientific evidence is not

available, being afraid of public debate or outcry.

2) The underlying principles appear obscure to managers or people who have little

knowledge about stream evolution and the interdependency of stream channels

and floodplains.

3) There might be constraints when it comes to the actual implementation of this

rule. One question would be how to draw a setback sized with this equation at a

particular site. The width computed using this formula is the full width of the

predicted meander belt or streamway by which the stream channel is included, as

shown in Figure3 (Mathews 2006). The morphologic characteristics of a stream

reach along with the topographic feature of the site need to be examined before a

setback plan can be determined. In consequence, the implementation of this type

of setback often requires more technical expertise and administrative efforts, as

opposed to that of the riparian buffer ordinances.

Figure 3: Illustration of an 82ft setback designed using streamway concept (Mathews 2006)

12 By reviewing the limited number of setback ordinances that fall in the “streamway” category, the author found that the exact formula used by authorities deviates from

Equation 2 to some degree. This could be attributed to the consideration of safety factors or other issues present in reality. However, what might be difficult to interpret is that in the setback ordinance developed by Franklin County OH, although the derivative of

Equation 2 has been used, the specific rule states that the calculated width is required to be divided by two “to calculate the setback for one side of the stream” (Franklin County

Board of Commissioners 2008, Section 650.09). This mix-and-match of setback design criteria might be evidence of the challenges confronting managers in practice, and could also suggest that the concept itself is not straightforward to be understood by an average person.

In addition, another difficulty in administering “streamway” setbacks lies in the independent variable of Equation 2. Drainage area is a measure of the extent of land where runoff is converged to a specified outlet of the . It is one of the essential characteristics of a stream or a watershed. As the definition suggests, a drainage area must be associated with a specified outlet point of a drainage basin. In other words, literally any point on a stream reach has a corresponding catchment that drains to it, and as the “point” moves from headwater toward downstream, the drainage area grows gradually. The continuity of drainage area along a stream poses a question as to which drainage area should be plugged into Equation 2. The Big Darby Creek Watershed

Setback Ordinance offers some guidance regarding how to choose DA, but the criterion is still vague and not quantified:

13 “If the DA remains relatively constant throughout the reach of interest, then the DA of the downstream edge of the stretch must be used. Where there is a significant increase in the DA from the upstream edge to the downstream edge of the area of interest, the setback width increases accordingly.” (Franklin County Board of Commissioners 2008,

Section 650.09)

1.4 Research Objective

The objective of this study is twofold:

1) To apply Equation 2 in stream setback sizing using the Big Darby Creek

Watershed as an example and develop automatic processes with GIS tools to map

setbacks on a watershed scale.

Traditionally, drainage areas are measured by delineating a drainage basin from

topographic maps. With the advancement of GIS technology and the easy access

of geospatial data nowadays, they can be delineated and measured automatically

by analyzing digital elevation models (DEMs) in a GIS environment (Maidment

2002). The key to the automation of setback sizing process is identifying

appropriate breakpoints to subdivide stream reaches into segments so that the

setback width for each segment can be calculated. Intuitively, a point where there

is a noticeable increase in drainage area as compared to the upstream edge should

be treated as the beginning of a new segment. This is in compliance with the

general guidelines in the Big Darby Creek Watershed Setback Ordinance quoted

above.

14 2) To evaluate the feasibility of applying setbacks of designed widths in the Big

Darby Creek Watershed.

As the previous section discussed, the width predicted by the Equation 2 represents the extent of the streamway a natural stream channel needs to self-adjust its meander pattern in response to natural disturbances and to maintain its dynamic equilibrium.

Ideally, stream setback should be designed no smaller than the necessary streamway to maximize its functionality. However, in many cases, the predicted streamway may cover land that has already undergone development, resulting in conflicts between setback implementation and current land use. Therefore, after the first objective is achieved, the author will take a step further to evaluate how feasible the designed setback can be applied, taking into account the existing land development in the Big

Darby Creek Watershed. The analysis will be of great interest, as it could become a measure of stresses that current development has placed on stream ecosystems and may have implications for future policies.

15

Chapter 2: Implementation Methodology

2.1 Data and Software

This research selected the Big Darby Creek Watershed as the study area, as the streamway setback has already been implemented in portions under Franklin County jurisdiction. Investigating the issue on a watershed scale can provide insights to both existing and potential implementers in this region, to facilitate collaborations across jurisdiction boundaries within a holistic watershed framework.

The Big Darby Creek Watershed has a total drainage area of 580 square miles and encompasses six county jurisdictions (Figure 4). The main stream, Big Darby Creek, runs from north to its with Scioto River at south, with a total length of over 80 miles (Gordon and Simpson 2001). The stream, together with its is home to an exceptional variety of rare freshwater species, e.g. 40 mussels and 100 fishes according to

USEPA’s record (Gordon and Simpson 2001). The enormous ecological value of the watershed has made it imperative to develop scientifically justifiable setback ordinances to ensure the health of the stream ecosystem.

A watershed boundary layer obtained from 12 digit watershed boundary dataset 1:24000 was used to clip out the area of interest, and a 30-m Digital Elevation Model (DEM)

16 dataset was prepared by merging the mosaic TIFF files provided by the National

Elevation Datasets (NED). Both the watershed boundary and NED datasets were downloaded from USGS Geospatial Data Gateway at no cost. The stream polyline layer used in this study was extracted from the National Hydrography Datasets (NHD) freely available at USGS website. The National Land Cover Dataset (NLCD 2006) was used to overlay with the produced setback map for feasibility evaluation.

Figure 4: Location of the Big Darby Creek Watershed

17 The study was performed using ArcGIS 10.0 along with Arc Hydro Tools (v2.0). Arc

Hydro is an ArcGIS-based module developed by ESRI professional team to support various water resources applications (Djokic, Ye, and Dartiguenave 2011). Among other geoprocessing (GP) tools, the most important Arc Hydro Tools used to implement streamway setback include Terrain Preprocessing Toolset and Batch Watershed

Delineation Tool.

ArcGIS 10.0 offers three ways for users to access the built-in GP functions: 1)

ArcToolbox, 2) Modelbuilder, and 3) Python Scripting. ArcToolbox allows users to execute a single tool through a dialog box. This is the most interactive way of performing analyses, but requires user input for every step. Therefore it may appear cumbersome and ineffective when multiple processes are to be repeated. Modelbuilder can chain together individual tools in sequence and create a workflow using visual programming language.

By this means, users are allowed to store the repetitive steps in a model embedded with input parameters and pre-conditions so that workflow automation can be realized. Under circumstances where there is a need for more advanced logic, batch processing or access of low-level GP functions/ArcObjects, python scripting then has to come into play.

Python scripting takes advantage of the free, cross-platform, open-source programming language and the pre-developed site package (i.e. Arcpy) to directly access GP tools, functions, classes and modules. (ArcGIS Desktop Help 10.0 2010)

For this study, all the steps were performed using python scripting, except the terrain preprocessing where only the first two methods were used. This is because the various steps involved in this terrain preprocessing were very standard and straightforward, with default parameter settings being used. The python scripts were written in PythonWin 18 Script Editor and then imported to ArcToolbox as script tools for execution. A toolbox called “Sizing Setback” was created to group together all the python modules developed, not only for the convenient storage of the python modules, but also for the purpose of making a portable toolset that could eventually benefit different users (Figure 5).

Figure 5: Customized toolset "Sizing Setback" storing script tools in the ArcToolbox

2.2 Workflow and Scripts

The workflow can be broken down into three major parts: 1) Terrain Preprocessing, 2)

Breakpoint Identification and 3) Setback Mapping. In order to implement the workflow, two key questions must be resolved, i.e. how to judge whether there is a significant

19 difference in the resulting streamway width and how to define drainage points for which watersheds can be delineated.

To address the first question, the author initiated an operating framework based on stream order. The stream order is an indicator originally developed by Horton to measure the degree of stream branching within a watershed (McCuen 1989). According to the definition, a first-order stream is a without any branches, while a second-order stream is a river reach formed by at least two first-order streams, so on and so forth

(Figure 6). Clearly, at the point where a higher order stream starts, the drainage area should have a significant boost, which justifies a different setback width to be considered.

After the streams are partitioned by stream order, every single reach should be under close scrutiny for further division (streams that are connected and have the same order were merged and treated as one single reach). A divide is considered necessary when the computed streamway width at one point is 10% greater than that of its upstream reference point (about 25% increase in the DA). In other words, for any given segment after subdivision, the streamway width difference between its upstream and downstream edge should be no greater than 10%.

The proposed operating framework requires a series of watershed delineations to be performed based on selected drainage points along a single reach, to enable the streamway width comparison and breakpoint identification. It then brings about the second key question as to which set of points should be placed in the drainage point pool for subsequent analyses. In ArcGIS, a stream reach is a polyline object comprised of a series of segments connected by common vertices (ArcGIS Desktop Help 10.0 2011), as

Figure 7 depicts. These segments and vertices are the basic constructs of polyline features, 20 embedded with important geometry attributes and spatial information which can be easily accessed through python scripts. As a matter of fact, it is natural that these segments be treated as the smallest unit in the subdivision process and drainage points should be selected from these vertices. Although further split of those segments is theoretically possible, the improved level of precision would be achieved at the expense of computing power, which proves to be unnecessary and impractical for implementation in real life.

Figure 6: Stream order classification

21

Figure 7: A sample stream reach constructed by segments and vertices

The rest of this section gives more details on the specific tools and implementation methods involved in each of the three parts of the workflow.

2.2.1 Terrain Preprocessing

The procedure started with terrain preprocessing, one of the most essential steps in water resources applications using Arc Hydro Tools (Djokic 2008). The procedure took the original DEM and the stream polyline layer as two inputs and produced a hydrologically- correct DEM (HydroDEM), two important grid files (i.e. flow direction and flow accumulation), as well as other interrelated layers, which all together created the backbone of the analyses. Figure 8 shows the workflow used in the terrain preprocessing, which was developed using ModelBuilder.

22 23

Figure 8: Terrain Preprocessing Workflow 23 “DEM Reconditioning” and “Fill Sinks” functions were first used to modify the raw

DEM. DEM Reconditioning is also called “Burning Stream”, the purpose of which is to correct DEM so that it is in good agreement with the actual stream valley topography.

What’s important to note is, by using a stream layer to recondition the DEM, the stream layer is assumed to have higher accuracy than the original DEM does. “Fill Sinks” function was used to remove artificial pits in the DEM. Pits are depressions where water flows in and stays “forever”. They are common in DEMs and usually “artifacts of DEM construction” (Djokic 2008). Obviously, the presence of sinks in a DEM causes inaccuracy in the derivation of flow direction and drainage network.

“D-8” method, the default algorithm employed by Arc Hydro was used to derive the flow direction grid from the HydroDEM. In a DEM grid, each grid cell is surrounded by 8 neighboring cells. D-8 method assumes that a water droplet follows the steepest downslope flow path from one cell to its eight neighboring cells. In other words, there is only one path that a water droplet takes as it leaves a raster cell (Garbrecht and Martz

2000), unlike the “D-infinity” algorithm where flow is partitioned among multiple paths.

Flow paths are coded according to the eight directions (Fig. 9), so with D-8 method, each raster cell is associated with a single number indicating the direction of water movement.

Although D-8 method may not be the exact replica of physical surface flow patterns in reality, it is widely used most likely due to its reasonable simplification and less computation power required. The flow accumulation grid was generated using the “Flow

Accumulation” tool in the terrain preprocessing toolset. This tool basically counts the number of grid cells that drain into each individual grid cell and assign the value to it,

24 based on the flow direction grid created in the previous step. This can best be illustrated by Figure 10.

Figure 9: Flow direction coding (Olivera et al. 2002). Each number is a code representing a direction.

Figure 10: Physical representation of flow direction grid and flow accumulation grid (Olivera et al. 2002)

The default threshold (i.e. 15549 cells, 1% of the maximum flow accumulation value) was used to determine which cells were considered as “stream”. This threshold selection guideline is just a rule of thumb (Djokic 2008), and resulted in many fewer stream reaches than the stream polyline layer contains (Figure 10). This large discrepancy results from the inherent limitation of the “support area threshold” approach (Tarboton and

Ames 2001), and might be overcome by using other methods that take into account the

25 spatial variability of , such as the one proposed by Tarboton and Ames

(2001). It can be seen from Figure 11 that the stream reaches omitted by this method are primarily headwater streams or small tributaries, and the main skeleton of the drainage network remains the same. Since the primary goal of this study is simply to test the feasibility of implementing the streamway setback approach in ArcGIS, it is acceptable to perform the test on just a subset of the actual stream network. Although studying how to improve the degree of resemblance between derived network and the real one would be valuable, it is beyond the scope of this study and could be an interesting subject for future exploration.

Figure 11: Comparison between stream polyline layer downloaded from NHD (left) and the drainage line generated by the terrain preprocessing using the default threshold (right)

26 2.2.2 Breakpoint Identification

2.2.2.1 Stream Order Classification

Stream order classification was performed using “Stream Order (Strahler Method)” under the “ (Spatial Analyst)” Toolset. The tool analyzed the stream network based on the flow direction grid and stream grid generated from the terrain preprocessing, and assigned stream order values. Unfortunately, the output from this tool was also a raster file, which had little use in the following analyses. Because of this, the “Zonal

Statistics as Table” was used to transfer the stream order value to the “Drainage Line” vector layer. The step-by-step instructions can be found at http://www.caee.utexas.edu/prof/maidment/giswr2011/giswr2011.htm, and Figure 12 summarizes the workflow of deriving a drainage line vector layer in which every single reach has a “StrahlerOrder” attribute that indicates the order of that stretch. A python module “StreamOrder.py” was written to incorporate this workflow and moreover, to extract stream reaches of the same order and save them into one separate feature class.

The number of output files generated by this module equals the total number of orders the input drainage network has. For this study, the third order stream is the highest in the derived stream network, so in total three output files were obtained (i.e. DrL_O1,

DrL_O2, and DrL_O3). The scripts of this python module are shown in Appendix B.1.

27 2

8

Figure 12: Stream Order Classification Workflow

28 According to the operating framework used here, streams that are connected and are of the same order shall be treated as a single reach for the following subdivision analysis. In that regard, a python module “MergeStream.py” (Appendix B.2) was developed to merge streams based on their connectivity. The output from this script has suffix “diss” in the file name, i.e. DrL_O1_diss, DrL_O2_diss, and DrL_O3_diss.

2.2.2.2 Single Reach Subdivision

As stated earlier the stream vertex set shall be treated as a drainage point pool in which points satisfying the “10%” criteria can be singled out. Therefore, a python module

“AllVertices.py” (Appendix B.3) was created to generate a feature class containing all the vertices on each single reach. The number of output point feature classes depends on the number of stream features (single reach) contained in the input stream polyline layer.

According to the naming convention, the vertex feature class generated for the first reach of first-order streams is named “DrL_O1_diss_V1”, and the one for second reach is

“DrL_O1_diss_V2”, so on and so forth.

It is important to point out that for an Nth order stream (N is not the highest), the last vertex by default is the intersection between this reach and the (N+1)th order stream.

Clearly, using this point to delineate watershed would cause overestimation of drainage area for the Nth order stream by including the drainage area of the tributary that with it. As a matter of fact, for any given stream that is not of the highest order in the network, the default endpoint will be moved towards the upstream edge at an offset distance. The required distance at which the endpoint is to be moved equals the cell size of the DEM used to derive the drainage network at the first place. The mathematical

29 coordinate transformation is shown in Figure 13 and was incorporated in the

“AllVertices.py” module.

Figure 13: Illustration of endpoint modification for lower order streams. Pn is the last vertex by default and Pn-1 is the vertex before the last, and P is the actual drainage point used for watershed delineation

a) All-vertices Delineation Method

The author first implemented an “All-vertices Delineation Method” where watershed was delineated for every vertex on a stream reach. This was realized by setting a vertex feature class as a batch point layer and input it into the “Batch Watershed Delineation” tool. The idea was to calculate the streamway width for every point and then scan the whole reach from the first point, grouping those with streamway differences no greater than 10%. This approach avoids the use of complicated algorithms and iterations, but unfortunately, requires extraordinarily large amount of processing time due to the tremendous number of vertices that are involved. The author tested it on a very small 30 second-order stream having 107 vertices (Figure 14), and the processing time required for batch watershed delineation turned out to be 54min 51 sec for a normal desktop PC (Intel

Core 2 Duo CPU, 2.93GHz, 3.00GB RAM). Albeit that this would not become a serious obstacle if parallel computing were employed, considering the limited access of most authorities to supercomputers, this method is very unlikely to be applicable in the real world context of setback implementation, and therefore is not worth further investigation.

Figure 14: The 2nd order stream reach used to test All-vertices Delineation Method (highlighted in blue)

b) Binary Search Method

A “Binary Search Method” was then developed so that the number of required watershed delineations can be significantly reduced. This method takes advantage of the commonly- used search algorithm, where the targeted object can be quickly identified by continually narrowing down the interval at which it is located. Simply put, to apply this algorithm in

31 finding stream breakpoints that fulfill the “10%” criteria, the stream reach is first divided into half if the streamway width difference (ΔSw) between the first point (reference point) and the last point is greater than 10%. Then the streamway width of the midpoint is compared against the reference point in order to determine in which half of the reach the first breakpoint is supposed to be. This “Breaking in half-Compare-Determine (BCD)” process repeats until the first breakpoint is located. Then the vertex is set after the first breakpoint as the new reference point and the BCD process is started again to scan the rest of the reach. It is worth mentioning that when the stream reach is divided by half, the midpoint may not necessarily be at the exact point where it is half way from the upstream edge, but rather is the vertex closest to that point. This approximation is a reasonable simplification, since it has been decided that the program-default polyline segment is used as the smallest unit for analysis. The binary search method, relying on more advanced logic is relatively complicated in terms of script implementation, and involves more flow controls and loops than appears in the above description. The detailed code is included in the python module “binarySearch.py” shown in Appendix B.4.

2.2.3 Setback Mapping

After the execution of “binarySearch.py” module was completed, three new fields,

“BreakPoint”, “Area_sq_mi” and “StreamwayWidth” were added to the vertex feature classes (e.g. DrL_O1_diss_V1, DrL_O2_diss_V2, etc.). In order to map setback widths for the whole watershed, it is necessary to transfer the streamway width associated with each vertex to the corresponding stream segments. Two standalone python modules were written to realize this width transfer (i.e. “split.py” and “joinSw.py”) as shown in

Appendix B.6 and B.7. Another script tool called “batchSplitMatch.py” (Appendix B.8) 32 was created to perform this transfer in a batch mode for streams in a same Strahler order category (i.e. DrL_O1_diss, DrL_O2_diss, and DrL_O3_diss). Lastly, all the polyline feature classes with the suffix “Sw” (i.e. output from “batchSplitMatch.py” module) were merged with the python module “mergeSw.py” to produce the final map of setback width distribution in the Big Darby Creek Watershed.

33

Chapter 3: Results and Discussion

3.1 Setback Width Distribution

Designed setback widths were mapped across the Big Darby Creek Watershed (Figure

15). In Figure 15 (a), streams are shown in different colors indicating segments where different setback widths are to be applied. It can be seen that generally most of the stream reaches experienced subdivision in order to fulfill the “10%” criteria, including some of the small first-order streams in the upstream portion of the watershed. Figure 15

(b) suggests that the designed setback ranges from 250.6 ft to 1795.7ft, having a considerably large span. It also shows the resulting breakpoints are more densely distributed towards the upstream portion of the watershed, indicating more frequent segmentations occurred at lower order stream reaches. This distribution pattern is within expectations, as the drainage area increases at a smaller rate when the stream reach is closer to the outlet of the watershed. What is noticeable from Figure 15 (b) is the larger number of occurrence of setback widths that fall in the range of 250 to 1800ft. The width values are rounded up to 10 ft, given the uncertainties associated with the derivation of the empirical streamway equation where records of multiple streams were generalized.

This value range corresponds very well to the setback widths most commonly used in the

34 “buffer” ordinances. However, there are also large width values associated with very long stretches of higher order streams. It is not surprising that these values are rarely seen in ordinances developed based upon the buffer concept, because of the fundamental differences between the two frameworks. By taking a closer look at Figure 15 (b), it is found that there are a few places where the breakpoints are overlapping or bounded together. These are usually confluence points where two or more stream reaches meet, leading to a significant increase in the drainage area. However, there are also occasions where only one breakpoint can be seen on the stream junctions. This is usually due to the fact that the impact of the lower order tributary is not large enough to “break” the higher order stream when joining it and the breakpoint is simply the endpoint of the lower order reach.

35 36

Figure 15: Stream setback mapping for the Big Darby Creek Watershed 36 The author also tested the scripts using different criteria (i.e. the maximum percentage of setback width differences within a single segment) for the purpose of validation and comparison. The processing time of different scenarios was plotted in Figure 16. It took a total of nearly 4.5 hours to complete the binary search for streams in all three order categories when the 10% criterion was used, as shown in Figure 16. The processing time was reduced by half when the 20%-criterion was in use. As the criteria became less and less stringent, the processing time continued to decrease, but at a descending rate. It can be seen from Figure 16 that beyond 50%, the amount of time shortened was not very significant. This is most likely due to the fact that all the first order streams remain undivided under the considerably coarse criteria, and only the higher order streams contributed to the difference in processing time.

Figure 16: Processing time when using different criteria as input

37 Admittedly, the improved computing efficiency could be a seemingly compelling argument to support the use of a less stringent criterion. However, the enlarged generalization effect could lead to a painful debate at the point where intense confrontations are found between stream preservation and existing land development.

Therefore, the processing time should by no means be the factor that dictates the selection of criteria, but the fineness of subdivision instead. In fact, the 4.5-hour processing time for a total of 28 reaches (approximately 210 miles in total length) is fairly reasonable. Considering the phenomenal speed at which the capacity of new computer processors is expanding, this will very unlikely become a practical issue even if a denser drainage network is to be analyzed.

The investigation on a watershed scale provides decision makers with a broad picture of the degree of stream protection needed in this region, but omits localized details that could be of great interest to individual regulatory entities. For that reason, the author further examined how the setback widths resulted from a watershed-scale analysis are distributed across the six counties that have portions located within the watershed boundary. The results could benefit localities, providing them with information necessary for developing and administering stream protection programs.

In order to perform the analysis, the setback map layer was split by the county boundaries and setback information was extracted for every county. A histogram was then constructed for each of the six counties, to count the number of distinct widths for each interval (100ft). To have a better idea of the longitudinal extent of stream reaches with which different setback widths were associated, the count in each interval was

38 transformed to the total length of streams having setback widths particularly laid in that range. The results of using both 10% and 30% criteria are displayed in Figure 17.

The histograms of the six counties reveal that under the 10% criteria, all the counties have setback width values that fall in the four intervals from 200ft to 600ft, except

Champaign which does not have a 400+ft setback and Pickaway which does not have

400+ and 500+ft setback. This finding is consistent with the pattern that was observed earlier on from the setback map as shown in Figure 15. Particularly interesting is that the width series starts from 200+ft for every county. This similarity is by no means a coincident but is rather resulted from the “threshold” method used in the terrain preprocessing to define a stream channel formation. In reality, a number of headwater streams with small drainage areas exist in this watershed as the comparison in Figure 11 reveals. It might be a reasonable management practice to simply apply the smallest width value computed in this study to any stream reach having a smaller drainage area, if the local site condition allows. For one thing, it would greatly improve management efficiency by minimizing tedious calculations. For the other, it is generally agreed that headwater streams deserve greater protection because of their indispensible functions to the entire watershed (Wenger 1999), which justifies the application of a wider setback.

However, if regulations require a precise setback width to be calculated even for a small headwater tributary, administrators have the option to use DEM and streamline vector layers of a sub-watershed as the input to get the required level of details, with the flexibility of the designed tools.

39

Figure 17: Setback width distribution in each county

40 Figure 17 continued

Continued

41 Figure 17 continued

By comparing the six counties’ histograms resulted from the analysis using the 10% criteria, it is clear that the width value distribution exhibits significant variance from county to county. Certainly, this is attributed to the different geographic locations of 42 these counties in the watershed. Not every county has streams of all the three orders, which accounts for the missing values in certain intervals. Overall, Logan and Pickaway have the most extreme width distribution pattern among the six neighboring counties. For

Logan, calculated setback widths are clustered in the lower end of the entire range (200-

500ft), and the total number and length of stream segments are both very small (Figure 17

A1). This is because the area under Logan County’s jurisdiction occupies only about 5% of the total watershed area (Table 1) and is located at the most upstream portion with a vast majority of stream reaches belonging to the first and second order categories.

Pickaway, on the other hand, although encompassing such a small watershed area as

Logan does, covers the furthest downstream fraction. Only a couple of first order tributaries exist in this county, while the rest of the streams are the trunk reaches of the highest order in this watershed. Therefore, it is not surprising that the county’s setback width values jump directly from 200~300 ft to nearly 1800 ft. Although only two stream reaches are to use this extremely wide setback, they are both long stretches having a total length of about 22 miles (Figure 17 F1). This would cause extensive amount of riparian areas to be reserved as setback, which might cause great challenges to localities who are trying to protect streams while not significantly compromising property rights at the meantime. As for the other four counties, the distribution of setback width tends to be more scattered (Figure 17 B1-E1), attributed to their higher diversity of drainage network.

To setback administrators in these counties, stretching a large setback over a considerably long distance may not be the top concern, but maintaining such a wide variety of widths could still become a challenging task in terms of site planning, coordination and monitoring. 43

Table 1: Acreage of different land covers in the setback riparian zone

Land Cover Code Land Cover Type Logan (ac) Champaign (ac) Union (ac) Franklin (ac) Madison (ac) Pickaway (ac) 11 Open Water 0.67 2.22 123.38 400.81 105.15 350.57 21 Developed, Open Space 7.78 73.36 229.41 355.46 191.18 96.48 22 Developed, Low Intensity 1.56 10.89 108.04 144.72 81.81 10.45 23 Developed, Medium Intensity 0.89 0.67 5.56 19.34 10.89 10.45 24 Developed, High Intensity 0.22 1.11 1.56 2.22 3.56 0.89 31 Barren Land - - - 18.23 1.33 3.33 41 Deciduous Forest 98.26 242.08 1192.42 2598.24 1816.19 953.22 42 Evergreen Forest - - 1.11 1.11 - 2.67 43 Mixed Forest - - - 3.56 3.56 411.26 71 Grassland/Herbaceous - 46.24 204.96 120.93 106.48 10.67 81 Pasture/Hay 25.79 51.35 343.01 733.59 883.20 141.83 82 Cultivated Crops 54.46 558.86 2070.50 868.97 1453.40 2544.45 90 Woody Wetlands - - 14.89 105.37 65.80 22.01 95 Emergent Herbaceous Wetlands - 4.45 87.14 20.67 131.60 2.67 Total Riparian Area 189.62 991.24 4381.98 5393.22 4854.14 4560.93 Watershed Area 19068.23 56842.33 80511.95 56319.71 108282.33 33995.89

When a less stringent criterion is adopted (30%), as shown in Figure 17 A2-F2, the overall distribution patterns of the six counties don’t seem to have significant changes, but apparently, in each individual county’s diagram, the bars representing the count are shortened at the lower range to a relatively large extent while those at the higher range are slightly lifted. This sort of “right-shift” and “contrast smoothing” trend is in excellent agreement with the expectation, as when a larger percentage is used as the criteria, the number of divisions is undoubtedly reduced, and greater average effect occurs.

3.2 Current Land Use

As stated earlier, the primary concern of implementing a streamway setback is its potential conflict with the existing land uses along riparian corridors. This conflict is deeply rooted in the divergence of the “a-stream-rules” design philosophy and the anthropocentric nature of land development. It is not uncommon that a floodplain has 44 already been encroached to some degree by human-imposed structures or activities in a highly urbanized watershed. In that case, adjustment might be inevitable, and setback regulation has to been put in place along with other land use regulatory tools, such as conservation easement, transfer of development rights, etc.

With the purpose of looking into the potential conflicts of implementing the resulting setback widths (10%-criteria) in the Big Darby Creek Watershed, the author analyzed the existing land use/land cover conditions in the riparian corridors of the six counties by using the most recent land cover data that is currently available. Ideally, the setback zones should be drawn in ArcGIS and then overlaid with the land cover layer to obtain the most accurate results. Unfortunately, however, no automatic mapping tools have been invented yet to draw setback on a watershed scale, which makes macro-level evaluation very difficult. As a matter of fact, a compromise was made where the ArcGIS Buffer Tool was used to create a buffer on both sides of a stream with the buffer distance set to half of the corresponding setback width. It is important to note that the strip zones created by this means is certainly not the exact setback, but rather a riparian zone that bears large resemblance to the actual setback (referred to as “setback riparian zone” afterwards).

Analyzing the current land use pattern within these zones, although is not perfect, still can offer some insights into the degree of development along water bodies in these counties and thus have implications to future policy making. Table 1 shows the acreage of land within each land cover type for all the counties and pie charts were constructed to give a clear view of the percentage composition (Figure 18).

45

Figure 18: Composition of different land covers in riparian corridors of all the six counties (%)

It is found from Table 1 that Pickaway County has the largest ratio of setback riparian zone to the total watershed area under its jurisdiction (4560.93/33995.89 = 13.42%) while

Logan has the smallest (189.62/19068.23= 0.99%). These are the two “extreme” counties 46 identified in Section 3.1 and the findings are consistent with what can be inferred from the previous analysis. Among the rest of the counties, Franklin County has the largest ratio which is 9.58% (5393.22/56319.71), followed by Union (4381.98/80511.95=5.44%),

Madison (4854.14/108282.33= 4.48%) and Champaign (991.24/56842.33=1.74%).

As can be seen from the pie charts, overall the development along streams is moderate in the Big Darby Creek Watershed, with the average percentage of developed lands being

6.71%. Pickaway County has experienced the least intense development where only about 2.67% of the total setback riparian area is categorized as developed area. Moreover, among those developed lands, open spaces account for about 80%. Open spaces are identified as area with impervious surfaces less than 20% of total land cover and most surfaces well vegetated in the form of lawn grasses. They are acceptable land use type in a designated setback zone, less likely to exert constraints on applying a streamway setback As a matter of fact, although Pickaway has the largest riparian area that needs be reserved for setback implementation, the potential conflict is actually not as big as we expect at the first glance. Franklin County, on the other hand, has the largest percentage of developed area in its setback riparian zone (9.67%), but the good news is the open spaces are also a big component of what is categorized as developed area (approximately

68%). For sporadic spots where building constructions get in the way, possible adjustments could be considered based on a careful review of the local site conditions.

One evident land cover distribution pattern of these six counties is the large amount of farmland existed in the setback riparian zone. Having agricultural lands dominated the land covers is a typical phenomenon in Ohio. It seems that whether to exempt agricultural activities or to impose regulations on productive lands has long been a point of discussion 47 in the implementation of buffer ordinances (U.S. EPA). It should be made clear that with the streamway approach of setback design, the presence of agricultural land in the setback zone is not so much a nuisance as it is for the buffer approach. This is because the farmland behaves just like any other open spaces in terms of flood assimilation.

Therefore, as long as no man-made structures or impervious surface that hinder the natural processes of meander migration have been constructed in the designated setback zone, the existing agricultural lands would not place too many constraints on the setback implementation.

48

Chapter 4: Conclusion

This study first demonstrates that the streamway width formula can be applied in ArcGIS to size stream setbacks for by taking advantage of ArcHydro’s efficient watershed delineation functionalities along with the flexibility of script customization in ArcGIS.

The proposed workflow for implementation is broken down into three major tasks: terrain preprocessing, breakpoint identification and setback mapping. The breakpoint identification is the most critical step where stream reaches are properly divided with drainage point determined for each segment in order to perform watershed delineation and drainage area computation. An operating framework is established to complete this task in which the drainage network in the watershed is first classified by stream order and then undergoes further division based on a user-specified criterion. The criterion reflects the maximum tolerable difference in the computed streamway widths between the upstream and downstream edge of an individual segment. It is recommended that a 10%- criterion be used which is equivalent to approximately 25% difference in drainage area.

The setback designed for the Big Darby Creek Watershed using this approach has a width value ranging from 250ft to 1800ft. Lower order reaches at the upstream experiences more frequent subdivision than the higher order streams, because the drainage area increment becomes less significant as the drainage point gets closer to the outlet of the

49 watershed. The Big Darby Creek Watershed encompasses six counties’ jurisdictions. The distributions of resulting setback widths vary appreciably from county to county, depending on their geographic locations in the watershed, which gives the localities different challenges in terms of actual implementation.

The various python script modules developed in this study are assembled into a portable toolbox that can be easily imported into ArcToolbox by any users with basic GIS skills.

The set of tools are suitable for analysis on stream reaches located in eastern U.S. It can not only be used to process watershed as big as the Big Darby Creek Watershed, but also applicable to sub-watersheds where a more detailed drainage network can be analyzed to include the small head-water streams omitted in this study. Users are allowed to input different DEM and streamline vector layers based on the level of details required.

Secondly, the study proves that it is generally feasible to implement the computed setback widths in the Big Darby Creek Watershed, because overall the watershed has not undergone intensive development along the riparian corridors, with an average of 6.71% land categorized as developed area in the setback riparian zone of the six counties.

Among those developed lands, open spaces have a considerably large weight, which alleviates the already small stresses exerted on the stream system. Furthermore, On average, the predominant land use type in the designated zones of the six counties is agriculture/farming. Since the farm land just like the other open spaces, is an acceptable type of land cover to be flooded, it would not cause severe conflicts to setback implementation unless man-made structures engaged in agricultural activities are to be erected or channel alteration takes place. To conclude, the tool package developed in this study automates the setback sizing procedure and could benefit local communities who 50 have interest in administering setback ordinances to maintain the health and integrity of stream systems. It can be applied to streams in any watersheds located in the eastern U.S.

However, for a highly urbanized watershed, there might be mundane constraints when setbacks resulted from this program are to be implemented. Adjustments might be inevitable depending on local site conditions. Nonetheless, the developed workflow and tools are still meaningful in that the calcualtion offers some sort of measures that could be indicative of the pressures placed on the natural streams by the current anthropogenic activities in the region. In addition, they also serve as a useful tool in translating scientific findings into polices and provide a framework where collaborative efforts to protect streams on a watershed scale are promoted.

Moving forward, it might be interesting to explore the possibility of inventing a method to actually draw the setback of the designed width in ArcGIS. The streamway formula determines the space that a stream channel needs to self-adjust its meander pattern in order to maintain its stability. It does not give specific guidelines as to how the “space” should connect to its adjacent floodplains. One way to do this would be applying the width at a channel cross section according to the bankfull depth and the topography of the stream valley at this location. The bankfull width can be looked up in the published hydrologic data tables, and the topographic feature of the channel cross section can probably be obtained by using DEM or integrating more advanced remote sensing technology such as LiDAR. The other possible way of drawing the setback would be using a simulated flood event to view how the flood surface is partitioned between the channel banks. The setback of designed widths can then be plotted following the same proportions. If this could be done, it could not only provide a more accurate way to 51 analyze potential conflicts that the designed setback have with the existing land uses, but would also further expand the capacity of the customized toolset in facilitating the implementation of setback ordinances.

52

References

ArcGIS Desktop Help 10.0. 2011. Polyline. 2010. The geoprocessing framework.

Djokic, D. 2008. Comprehensive terrain preprocessing using arc hydro tools. Redland, CA: ESRI.

Djokic, D., Z. Ye, and C. Dartiguenave. 2011. Arc hydro tools overview. Redland, CA: ESRI.

Franklin County Zoning Resolution, (2008): 650, http://www.franklincountyohio.gov/commissioners/edp/planning/streamsetbacks/Stre amSetbackRegulation-Approved.pdf.

Garbrecht, J., and L. Martz. 2000. Digital elevation model issues in water resources modeling. In Hydrologic and hydraulic modeling support : With geographic information systems., eds. D. Maidment, D. Djokic, 1. Redland, CA: ESRI.

Gordon, S. I., and Simpson, J. W.1994 Maintaining and improving water quality in the Big Darby Creek Watershed: agricultural and urban nonpoint water pollution. Columbus, OH: Department of City and Regional Planning, Department of Landscape Architecture, The Ohio State University.

Lee, Philip, Cheryl Smyth, and Stan Boutin. 2004. Quantitative review of riparian buffer width guidelines from canada and the united states. Journal of Environmental Management 70 (2) (2): 165-80.

Maidment, David R. 2002. Arc hydro :GIS for water resources. Redlands, Calif: ESRI Press.

Mathews, J. 2006. Post-construction storm water practice. In Rainwater and land development: Ohio’s standards for stormwater management, land development and urban stream protection. 3nd ed. Columbus, OH: Ohio Department of Natural Resources (ODNR).

53 Mayer, P. M., S. K. Reynolds, M. D. McCutchen, and T. J. Canfield. 2005. Riparian buffer width, vegetative cover, and nitrogen removal effectiveness: A review of current science and regulations. Environmental Protection 22 (EPA/600/R-05/118).

McCuen, Richard H. 1989. Hydrologic analysis and design. 2nd ed. Upper Saddle River, N.J.: Prentice Hall.

NOACA(Northeast Ohio Areawide Coordinating Agency). Principle of riparian zone protection. 2009 [cited 6/14 2012]. Available from http://www.noaca.org/storm_water.html.

Olivera, F., J. Furnans, D. Maidment, D. Djokic, and Z. Ye. 2002. Drainage systems. In Acr hydro: GIS for water resources. Redland, CA: ESRI.

Patti Banks Associates, and Inc Applied Ecological Services. 2006. Stream corridor protection and adaptive management manual.

Rosgen, David L. 1994. A classification of natural rivers. Catena 22 (3) (6): 169-99.

Schwartz, S. 2006. Riparian setbacks: Technical information for decision makers. Cleveland, Ohio: Chagrin River Watershed Partners,Inc., .

Tarboton, D., and D. P. Ames. 2001. Advances in the mapping of flow networks from digital elevation data. Orlando, FL: World Water and Environmental Resources Congress.

U.S. EPA. Model ordinances to protect local resources. http://www.epa.gov/owow/NPS/ordinance/mol1.htm. Accessed on Jul 24, 2012

Walter, M., J. Archibald, B. Buchanan, H. Dahlke, Z. Easton, R. Marjerison, A. Sharma, and S. Shaw. 2009. New paradigm for sizing buffer to reduce risks of polluted stormwater: Practical synthesis. Journal of Irrigation and Drainage Engineering 135 (No. 2, March/April): 200-9.

Ward, A., J. D’Ambrosio, J. Witter, A. Jayakaran, and D. Mecklenburg. 2009. Floodplains and streamway setbacks. the ohio state university extension factsheet AEX-445-02. Columbus, Ohio: .

Ward, A., D. Mecklengurg, J. Mathews, and D. Farver. 2002. Sizing stream setbacks to help maintain stream stability. No. 022239 ed. St. Joseph, Mich.: ASAE meeting paper.

Ward, Andrew D., and Stanley Wayne Trimble. 2004. Environmental hydrology. 2nd ed. Boca Raton: Lewis Publishers.

54 Wenger, S. 1999. A review of the scientific literature on riparian buffer width, extent and vegetation. Athens, Georgia: Institute of Ecology, University of Geogia, .

Wenger, S., and L. Fowler. 2000. Protecting stream and river corridors : Creating effective local riparian buffer ordinances. [Athens, GA]: Carl Vinson Institute of Government, the University of Georgia.

Wet Weather Solutions Program. STREAM SETBACK ORDINANCE FACT SHEET.

55

Appendix A: Sizing Setback Tools User Manual

The script tools developed in this study are aimed at assisting setback regulators designing proper setback widths for streams in the eastern U.S. The tools are arranged into a toolbox named “Sizing Setback.tbx” which is portable and can be easily imported to the ArcGIS desktop package by any users with basic ArcGIS knowledge. This toolbox does not include the terrain preprocessing functions that are readily available in the

ArcHydro add-on. Therefore, the “Sizing Setback” toolbox should be used along with

ArcHydro Terrain Preprocessing Tools to produce desired results. The ArcHydro tool package can be downloaded from http://blogs.esri.com/esri/arcgis/2011/10/12/arc-hydro- tools-version-2-0-are-now-available/. To start the design process, two prerequisite datasets are required: Digital Elevation Model (DEM) and a stream line vector layer.

Both of them are fed into the terrain preprocessing workflow at the first step, which generates a series of raster and vector datasets necessary to trigger the subsequent sizing procedure. There is no specific requirement as to what level of precision that the input datasets should have. Users are recommended to make selections based on factors such as data availability, computer processing capability and desired outcome accuracy.

However, it is important to note that, the vector dataset of stream lines must be accurate

56 at a higher confidence level in order to produce meaningful results, because it is the basis of DEM reconditioning.

The following section summarizes the general workflow of streamway setback design and gives step-by-step instructions of using the “Sizing Setback” toolbox for each procedure involved in this process.

1. Terrain Preprocessing

Terrain preprocessing functions can be accessed through Terrain Preprocessing Tools

in the ArcHydro Toolbox or ArcHydro Toolbar (Figure 19). Exhaustive guidance of

how to use this set of tools can be found in the tutorials enclosed in the tool package

downloadable from the aforementioned site and thus it is omitted in this user manual.

Specifically, tools required to conduct terrain preprocessing relevant to setback

design include: DEM Reconditioning, Fill Sinks, Flow Direction, Flow

Accumulation, Stream Definition, Stream Segmentation, Drainage Line Processing,

Catchment Grid Delineation, Catchment Polygon Processing, and Adjoin Catchment

Processing. Please refer to Figure 7 for the detailed workflow.

57

Figure 19: ArcHydro Toolbox (left) and ArcHydro Toolbar (right)

2. Stream Order Classification

Place the various python script modules and the “sizing setback.tbx” toolbox in the

same directory on your computer. Add the “Sizing Setback” Toolbox into

ArcToolbox window from the local drive. Double click on the “Stream Order

Classification” tool (Figure 20), and input the Flow Direction Grid (“fdr”), Stream

Grid (“str”) and Drainage Line Feature Class (“DrainageLine”) that were produced in

Step1 -Terrain Preprocessing, click OK. This tool generates a set of stream feature

classes, each containing streams of the same order. “DrL_O” suffixed with a number

representing the order of streams is the name convention used, e.g. DrL_O1, DrL_O2,

etc.

58

Figure 20: Stream Order Classification Tool

3. Merge stream links that are of the same stream order and interconnected.

Double click on “Merge Connected Stream Segments” Tool (Figure 21). Input

“DrL_O1”, and click “OK”.

Figure 21: Merge Connected Stream Segments Tool

59 Repeat the process for all the feature classes generated from Step 2. This tool can be

used for any stream line feature classes as long as the input file has “HydroID” and

“NextDownID” fields that indicate connectivity. The output files from this process

are named using the input file name with a “diss” suffix (e.g. DrL_O1_diss,

DrL_O2_diss, etc.)

4. Find all the vertices on stream reach

Double click on the “Find All Vertices” Tool (Figure 22). Input one of the files output

from Step 3 (e.g. DrL_O1_diss). Specify the cell size (unit: meters) of the raw DEM

used in the terrain preprocessing. If the streams contained in the input file are of the

highest order in the watershed, check the box of “Highest Order”, and then hit “OK”.

This operation produces a series of point feature classes. Each one contains all the

vertices along one single reach in that input file. The output point feature classes are

named using the input file name suffixed with a letter “V” representing “vertex”

followed by a sequencing number (e.g. DrL_O1_diss_V1, DrL_O1_diss_V2, etc.)

The process needs to be repeated for every file generated from Step 3.

60

Figure 22: Final All Vertices Tool

5. Search stream breakpoints

Double click on the “Search Breakpoints” Tool (Figure 23) and input one of the

output vertex feature classes produced in Step 4. Specify the criteria to be used. If the

subdivision will be made based on the criteria that setback width differences within a

segment is no greater than 10%, then enter 0.1. Don’t enter “10%”, because the

program is set up in such a way that only decimal format will be accepted. A group of

three files will be output from this operation, named using the input file name

suffixed with “wshd”, “wshd_P” and “breakPnt”, corresponding to the watersheds

delineated in the iterations, the drainage outletsused for those delineations and the

identified breakpoints, respectively. Apart from that, in the input file three new fields

will be added and automatically populated, namely Breakpoint, Area_sq_mi, and

StreamwayWidth.

61

Figure 23: Search Breakpoints Tool

This tool can be used to analyze one reach at a time, and if batch processing is desired, then use the “Search Breakpoints Batch Mode” Tool (Figure 24). To run the tool, enter the order of streams to be processed first, such as 1, 2, and 3, etc. Then similarly to the single reach analysis, specify the criteria to be used. Lastly, navigate to your workspace by using the browse button, and input the directory where your vertex feature classes are located. Then the batch processing tool will perform binary search for all the stream reaches in this order group at one time.

62

Figure 24: Search Breakpoints Batch Mode Tool

6. Transfer computed setback width from vertex feature class to stream feature class.

Upon completion of Step 5, appropriate breakpoints are identified and in other words

stream subdivision is completed with setback width calculated for each breakpoint.

The purpose of Step 6 is to transfer the resulting setback width from breakpoints to

stream segments. In order to do this, first double click the “Split Stream at Vertices”

Tool (Figure 25). Inputone of the merged stream feature classes generated in Step 3

(e.g. DrL_O1_diss, DrL_O2_diss). Then click “OK”. This tool creates a series of

stream line feature classes, each of which containing a number of small segments

defined by vertices in that reach. According to the naming convention, the output files

are named by using the input file name suffixed by “S”, a sequence number and

“splitLine”. The total number of files output from this operation equals the number of

output from the “Find All Vertices” Tool.

63

Figure 25: Split Stream at Vertices Tool

After the streams are split, use the “Associate Setback Width to Stream” Tool (Figure

26) to make the width transfer happen. Specify the vertex feature class and its corresponding split stream feature class (e.g. DrL_O1_diss_V1 and

DrL_O1_diss_S1_splitLine). Make sure the two input files are an exact match by checking their sequence numbers. After this operation is done, a file suffixed with

“Sw” will be created (e.g. DrL_O1_diss_S1_Sw) which is a stream feature class with streamway width populated for each divide.

64

Figure 26: Associate Setback Width to Stream Tool

Alternatively, the program offers a way to perform the width transfer in a batch mode for one stream order group at a time. Double click the “Batch Stream Split and

Setback Match” Tool (Figure 27). Input one of the output files from Step 3. Hit

“OK”. Then a series of “Sw” files will be automatically generated for the streams in this order group. Repeat this operation for the other stream order groups.

Figure 27: Batch Stream Split and Setback Match Tool 65 7. Combine separate stream feature classes that contain streamway width into a single

feature class.

Step 7 is the last step in the entire workflow where all the “Sw” files will be merged

to produce a single layer for the whole watershed. Use the “Merge Setback Width”

Tool (Figure 28). Specify the workspace where the “Sw” files are stored and give the

output file a name, such as “SwMerge”. Hit “OK” to complete the final step of the

setback design process. Just add the output feature class to ArcMap for further

analysis or visual representation.

Figure 28: Merge Setback Width Tool

It might have already been noticed that the users are not allowed to name the output

files for all the steps except the last one. This is the way the program was developed,

for the purpose of making it easier to pass interim files along. Since the file names are

hard-coded in the scripts, it would cause problem when a tool to be executed creates a

file with a name that has already existed in the target workspace. To address this 66 issue, a tool called “Clear Workspace” (Figure 29) was developed to help the user delete unnecessary files or files that would cause naming problem at a later step. This tool takes two inputs: a target workspace to be cleared and a phrase shared by files-to- remove in their names. The input phrase is used as a wildcard to search all the matching files in that workspace. For example, if files “DrL_O1_diss_V1”,

“DrL_O1_diss_V2”, “DrL_O1_diss_V3”,etc. are to be deleted, then enter “_V” in the tool dialog box.

Figure 29: Clear Workspace Tool

67

Appendix B: Python Scripts

B.1 StreamOrder.py '''------Tool Name: Stream Order Classification Source name: StreamOrder.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input Flow Direction Grid (1) Input Stream Grid (2) Input DrainageLine Feature Class

Output files: a) DrainageLine Feature Class with Field "StrahlerOrder" populated b) Subsets of DrainageLine Feature Class, each of which contains streams of same order

Description: Determine stream order based on Strahler method, generate a drainage line feature class with "StrahlerOrder" field populated and group streams of same order into one feature class subset. ------''' import os import arcpy ext = arcpy.CheckExtension("spatial") if ext =="Available": arcpy.CheckOutExtension("spatial") else: arcpy.AddMessage("The Spatial Analyst Extention is not available") fdr = arcpy.GetParameterAsText(0) #get the flow direction grid input str = arcpy.GetParameterAsText(1) #get the stream grid input drainLine = arcpy.GetParameterAsText(2) #get the drainageLine feature class input rasterDir = os.path.dirname(fdr) vectorDir = os.path.dirname(drainLine) arcpy.env.workspace = rasterDir arcpy.env.overwriteOutput = 1 strOrRas = arcpy.sa.StreamOrder(str,fdr,"#") arcpy.env.workspace = vectorDir 68 fields = arcpy.ListFields(drainLine) fieldList = [i.name for i in fields]

#add the field "strahlerOrder" if not "StrahlerOrder" in fieldList: arcpy.AddField_management(drainLine,"StrahlerOrder","short")

#populate the field "StrahlerOrder" outZtable = "zonalStat_" + os.path.basename(drainLine) outZstat=arcpy.sa.ZonalStatisticsAsTable(drainLine,\ "arcid",strOrRas,outZtable) arcpy.JoinField_management(drainLine,"arcid",outZtable,"ARCID","MIN") arcpy.CalculateField_management(drainLine,"StrahlerOrder","!MIN!","PYTHON") arcpy.DeleteField_management(drainLine,"MIN")

#Find the maximum order in the stream dataset outStatsTable = vectorDir+"\\maxOrder" arcpy.Statistics_analysis(drainLine,outStatsTable,[["StrahlerOrder","MAX"]]) sc = arcpy.SearchCursor(outStatsTable) row = sc.next() maxOrder = row.MAX_StrahlerOrder del sc arcpy.AddMessage("The highest stream order is: %d"%(maxOrder))

#extract streams of the same order and make them into one separate feature class order = 1 while order < maxOrder or order == maxOrder: outFC = "DrL_O%s"%(order) where_clause = '"StrahlerOrder" = %d'%(order) arcpy.Select_analysis(drainLine,outFC,where_clause) order = order + 1

B.2 MergeStream.py '''------Tool Name: Merge Connected Stream Segments Source Name: MergeStream.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input the drainage line feature class to be merged (in order to run, the feature class must have HydroID and NextDownID fields)

Output: a) The merged stream feature class Description: Merge stream segments based on connectivity ------''' def mergeStr(stream): """Merge stream segments based on connectivity""" import arcpy,os arcpy.env.workspace = os.path.dirname(stream) arcpy.env.overwriteOutput = 1 Fields = arcpy.ListFields(stream) 69 fieldNames = [field.name for field in Fields]

if "HydroID" in fieldNames and "NextDownID" in fieldNames: if not "Connectivity" in Fields: #add connectivity field to be used as dissolve field later arcpy.AddField_management(stream,"Connectivity","LONG")

sc = arcpy.SearchCursor(stream) originList = [] #Create a list to hold the (HydroID, NextDownID) pairs for row in sc: ID,nextID = row.HydroID,row.NextDownID originList.append((ID,nextID)) del sc

tempList = [] #Create a temp list to hold the (HydroID, nextDownID) pairs of connected stream segments i = 0 #To count the merged streams

while originList: seg = originList.pop(0) tempList.append(seg) for ID,nextID in originList: if ID in seg: seg = (ID,nextID) tempList.append(seg) for tempID, nextTempID in tempList: #remove the segments that have already been merged from originList if (tempID,nextTempID) in originList: originList.remove((tempID,nextTempID))

i = i + 1 uc = arcpy.UpdateCursor(stream) #Create an update cursor to populate the connectivity field for row in uc: ID,nextID = row.HydroID,row.NextDownID if (ID,nextID) in tempList: row.Connectivity = i uc.updateRow(row) del uc tempList = [] #Clear the temp list and continue the while loop to merge other streams

outFC = os.path.dirname(stream) + "\\" + os.path.basename(stream) + "_diss" dissolve_field = "Connectivity" statistic_fields = [["from_node","MIN"],["to_node","MAX"],["HydroID","MIN"],["NextDownID","MAX"]] arcpy.Dissolve_management(stream,outFC,dissolve_field,statistic_fields)

arcpy.AddMessage("There are %s streams after merge"%(i))

else: arcpy.AddMessage("Error: Input dataset lack necessary attributes.") arcpy.AddMessage(" It cannot be processed.")

if __name__ == "__main__": import arcpy drainLine = arcpy.GetParameterAsText(0) # Get the input drainage line feature class (in order to run, the feature class must have HydroID and NextDownID fields) 70 mergeStr(drainLine)

B.3 AllVertices.py and its sub-module distanceCal.py '''------Tool Name: Find All Vertices Source Name: AllVertices.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input a stream feature class. Streams must already be merged. (1) DEM Cell Size (default 30m) (2) Boolean arguments to indicate whether the input is stream of the highest order

Output: a) N point feature classes that have all the vertices of each stream reach. N equals the number of stream features in the input.

Description: Find all the vertices for each of the stream reaches in the input dataset. Create a single point feature class for each stream to store the vertices. But for the last vertex of a reach that is not of the highest order, replace it with offset point. Calculate the accumulative distance between each vertex and the origin of the reach. ------''' def find_vertices(stream,sizeDEM = 30, maxOrder="false"): """find all the vertices of a single stream reach and store them in a point feature class and calculate the distance of each vertex to the first vertex of the reach"""

import arcpy, os, math from distanceCal import locate_vertices

vectorDir = os.path.dirname(stream) strName = os.path.basename(stream) arcpy.env.workspace = vectorDir arcpy.env.overwriteOutput = 1 sc = arcpy.SearchCursor(stream) #create a search cursor to loop through all the stream features in the input

dsc = arcpy.Describe(stream) shapeFieldName = dsc.ShapeFieldName #Locate the shape field of the input stream feature class fields = arcpy.ListFields(stream,"*HydroID") for field in fields: fName = field.name #Assume only one field contains "HydroID" i = 0 #Initiate a counter to register the number of stream features for row in sc: #Get the XY coordinates of all vertices i = i + 1 ID = row.getValue(fName) geometry = row.getValue(shapeFieldName) #Create the geometry object geometry pntArray = geometry.getPart(0) n = geometry.pointCount - 1 #Get the index of the last vertex on the stream outFC = strName + "_V" + str(i) 71

#Create a point feature class for every row in the input to store the vertices arcpy.CreateFeatureclass_management(vectorDir,outFC,"POINT","#","#",\ "#",stream)

arcpy.AddField_management(outFC,"HydroID","LONG")

ic = arcpy.InsertCursor(outFC)

#The last vertex will not be saved to the point FC, but the offset point instead for x in range(n): pnt = pntArray.getObject(x) newPntObj = arcpy.Point(pnt.X,pnt.Y) #Create a point object newFeat = ic.newRow() #Create a new row newFeat.shape = newPntObj #Set the shape of the new feature to be the point object newFeat.HydroID = ID ic.insertRow(newFeat) #Insert the new feature into the table

Xn_1,Yn_1 = pnt.X,pnt.Y nPoint = pntArray.getObject(n) Xn,Yn = nPoint.X, nPoint.Y

#Selection of last vertex depends on the order of the stream if maxOrder == "false": offset = int(sizeDEM) distance = math.sqrt((Xn-Xn_1)**2 + (Yn-Yn_1)**2) X_endpoint = offset/distance*(Xn_1 - Xn) + Xn Y_endpoint = offset/distance*(Yn_1 - Yn) + Yn newPntObj = arcpy.Point(X_endpoint,Y_endpoint) else: newPntObj = arcpy.Point(Xn,Yn)

newFeat = ic.newRow() newFeat.shape = newPntObj newFeat.HydroID = ID ic.insertRow(newFeat) del ic

del sc arcpy.AddMessage("%s point feature classes have been created."%(i))

vertexFCs = arcpy.ListFeatureClasses(strName + "_V*") for fc in vertexFCs: locate_vertices(fc)

if __name__ == "__main__": import os, arcpy drainLine = arcpy.GetParameterAsText(0) #Get the input stream dataset cell_size = arcpy.GetParameterAsText(1) #Get the cell size of the DEM highestOrder = arcpy.GetParameterAsText(2) #Get the stream order informaton find_vertices(drainLine, cell_size, highestOrder)

'''------Tool Name: Locate Vertices Source Name: distanceCal.py 72 Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input a point feature class that contains all the vertices of a single stream reach

Output: a) Add a field called "Distance" to the input feature class and populate the field

Description: Locate every vertex on a single stream reach (distance to the first vertex on the reach).Used as a sub-module of AllVertices.py ------''' def locate_vertices(pntFC): """find the distance of each vertex to the first vertex on the stream reach""" import math,arcpy

fields = arcpy.ListFields(pntFC) if not "Distance" in fields: arcpy.AddField_management(pntFC, "Distance","DOUBLE") #Add a new field

dsc = arcpy.Describe(pntFC) shapeFieldName = dsc.ShapeFieldName #Locate the geometry field of the input point feature class

sc = arcpy.SearchCursor(pntFC) #Get the total number of records in the feature class sum = 0 for row in sc: sum = sum + 1 del sc

uc = arcpy.UpdateCursor(pntFC) row = uc.next() row.Distance = 0 uc.updateRow(row) dist = 0

#the first record has been updated already, so only loop through (n-1) records for i in range(sum - 1): pntGeometry = row.getValue(shapeFieldName) pntObj = pntGeometry.centroid x1 = pntObj.X y1 = pntObj.Y #get the coordinates for the first point uc.next() #cursor moves to the next point pntGeometry = row.getValue(shapeFieldName) pntObj = pntGeometry.centroid x2 = pntObj.X y2 = pntObj.Y #get the coordinates for the second point dist = dist + math.sqrt((x1-x2)**2 + (y1-y2)**2) row.Distance = dist uc.updateRow(row) if __name__ == "__main__": import arcpy,os verticesFC = arcpy.GetParameterAsText(0) arcpy.env.workspace = os.path.dirname(verticesFC) 73 arcpy.env.overwriteOutput = 1 locate_vertices(verticesFC) arcpy.AddMessage("All the vertices have been located on the stream reach.")

B.4 binarySearch.py and its sub-module compareSw.py, batchPoints.py '''------Tool Name: Search Breakpoints Source Name: binarySearch.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0)Input point feature class that contains all the vertices of a single stream reach (after merge)and has a field called "Distance", which calculates the distance from each vertex to the origin of the stream reach feature. (1)Input the subdivision criteria (e.g. "0.1","0.2",etc.)

Output: a) Populate the new field "BreakPoint", "Area_sq_mi", "StreamwayWidth" in the input feature class b) A feature class containing breakpoints of the stream reach c) A polygon feature class containing delineated watershed (e.g. DrL_O1_diss_V1_wshd) d) A point feature class containing batch points for watershed delineation (e.g.DrL_O1_diss_V1_wshd_P)

Description: Perform "binary search" algorithm to locate the breakpoints on a stream reach that could divide the reach into segments within which the drainage area increase is no greater than the user-specified percentage. The default is 10%. ------''' def binarySearch(pntFC, criteria): """performs binary search on pntFC to locate breakpoints""" import arcpy, os, math,compareSw from compareSw import compare

dirGDB = os.path.dirname(pntFC) dirFolder = os.path.dirname(dirGDB)

baseName = os.path.basename(pntFC) fieldList = arcpy.ListFields(pntFC,"StreamwayWidth") fieldNames = [field.name for field in fieldList] if fieldNames: arcpy.AddMessage("Warning: " + baseName + " was previously processed.") arcpy.AddMessage(" Please clear the input file and the workspace.") arcpy.AddMessage(" Then restart the script tool.") else: #Loop through the point feature class table, and generate a distance ditionary using OBJECTID as key and Distance as value distanceDict ={} sc = arcpy.SearchCursor(pntFC) for row in sc: distanceDict[row.OBJECTID]=row.Distance del sc

keyList = distanceDict.keys() #create a list containing all the keys(IDs) 74 keyList.sort() valueList = distanceDict.values() #create a list containing all the distance values valueList.sort() #assumption:distance ascending with objectID def midPoint(startPoint, endPoint): """Given the start point ID and end point ID, find the ID of the approximate midpoint""" halfDist= (distanceDict[endPoint]-distanceDict[startPoint])/2.0

#get the segment defined by start and end points keySub = keyList[(startPoint -1):endPoint] diffList=[math.fabs((distanceDict[i]-distanceDict[startPoint])-\ halfDist) for i in keySub] minDiff = min(diffList) return keySub[diffList.index(minDiff)] #The index of the start point in the keySub is 0 logFile = open(dirFolder + "\\" + os.path.basename(pntFC) + "_log.txt","w")

#create a log file to record the break point IDs logFile.write("Break Point ID:\n")

RefID = keyList[0] startID = RefID endID = keyList[-1] breakPoints = [] percent = float (criteria) while compare(pntFC,RefID,endID)> percent: while startID < endID: midID = midPoint(startID,endID) SwDiff = compare(pntFC,RefID,midID) if SwDiff == percent: breakPntID = midID break elif SwDiff > percent: endID = midID else: midID_next = keyList[keyList.index(midID) + 1] SwDiff_next = compare(pntFC,RefID,midID_next) if SwDiff_next > percent: breakPntID = midID break elif SwDiff_next == percent: breakPntID = midID_next break else: startID = midID

breakPoints.append(breakPntID) logFile.write(str(breakPntID) + "\n")

#take the one after breakpoint as new reference point (indicate the beginning of a new segment) RefID = keyList[keyList.index(breakPntID) + 1] startID = RefID endID = keyList[-1]

75 breakPoints.append(endID) #Add the stream endpoint to the breakpoint list arcpy.env.workspace = dirGDB arcpy.env.overwriteOutput = 1

#List all the feature classes having "wshd" in their names wshdFC = arcpy.ListFeatureClasses("wshd*") #List all the feature classes having "wshd_P" in their names wshdPntFC = arcpy.ListFeatureClasses("wshd_P*")

mergeList = [] for file in wshdFC: if not file in wshdPntFC: mergeList.append(file)

if len(mergeList) > 1: #Merge all the wathershed files generated from watershed delineation of the search procedure arcpy.Merge_management(mergeList,baseName + "_wshd") for item in mergeList: arcpy.Delete_management(item) #Delete watershed files

else: #Rename the file arcpy.Rename_management(mergeList[0],baseName + "_wshd")

if len(wshdPntFC)>1: #Merge all the watershed point files generated from watershed delineation arcpy.Merge_management(wshdPntFC,baseName + "_wshd_P") for fc in wshdPntFC: arcpy.Delete_management(fc) #Delete watershed point files

else: arcpy.Rename_management(wshdPntFC[0],baseName + "_wshd_P")

listBP = arcpy.ListFeatureClasses("*BP*") #Delete interim file that contains "BP" in its name for item in listBP: arcpy.Delete_management(item)

#Loop through the merged watershed feature classes to obtain the Streamway width of breakpoints sc = arcpy.SearchCursor(baseName + "_wshd") breakPntDict = {} #Create a dictionary to store the breakpoints and the associated drainage area and streamway width for row in sc: originID = int(row.Name[9:]) if originID in breakPoints: breakPntDict[originID]=(row.Area_sq_mi,row.Streamway_Width) del sc

addFields = [('BreakPoint','SHORT'), ('Area_sq_mi','DOUBLE'),\ ('StreamwayWidth','DOUBLE')] for field, dataType in addFields: arcpy.AddField_management(pntFC, field, dataType)

uc = arcpy.UpdateCursor(pntFC) #populate new fields for row in uc: ID = row.OBJECTID for breakPntID in breakPoints: 76 if breakPntID > ID: row.BreakPoint = 0 row.Area_sq_mi,row.StreamwayWidth= breakPntDict[breakPntID] break elif breakPntID == ID: row.BreakPoint = 1 row.Area_sq_mi,row.StreamwayWidth= breakPntDict[breakPntID] break

uc.updateRow(row) del uc

outBreakPnt = baseName + "_BreakPnt" where_clause = '"BreakPoint" = 1' arcpy.Select_analysis(pntFC,outBreakPnt,where_clause)

msg = “Breakpoints of “ + baseName + “ are:” arcpy.AddMessage(msg) for i in breakPoints: arcpy.AddMessage(str(i))

compareSw.TempPntDict = {} compareSw.temp = [] if __name__ == "__main__": import arcpy,os verticesFC = arcpy.GetParameterAsText(0) # Input the feature class of stream vertices number = arcpy.GetParameterAsText(1) # Specify the criteria arcpy.env.workspace = os.path.dirname(verticesFC) arcpy.env.overwriteOutput = 1 binarySearch(verticesFC,number)

'''------Module Name: compareSw.py Author: Ming Sheng Description: Submodule of binarySearch.py ------'''

TempPntDict = {} #create a dictionary to store points whose streamway width has been calculated in the process temp = [] #count the number of delineation performed def compare(basePntFC,ID1,ID2): """perform batch watershed delineation using ID1,ID2 as the batchpoints, compute and compare streamway width of the pair""" import arcpy,ArcHydroTools,os, batchPoints directory = os.path.dirname(basePntFC) #baseName = os.path.basename(basePntFC) arcpy.env.workspace = directory arcpy.env.overwriteOutput = 1 dirGDB = os.path.dirname(directory)

batchPnts = [] if not ID1 in TempPntDict.keys(): batchPnts.append(ID1)

if not ID2 in TempPntDict.keys(): batchPnts.append(ID2)

77 #if the list has something in it then perform batch processing, otherwise just find the streamway width from the temp dictionary if batchPnts: #create a new batchpoints pairBatch = batchPoints.batch_points(basePntFC, batchPnts) #perform batch watershed delineation funcOut1=ArcHydroTools.SetTargetLocations("HydroConfig","Layers",\ dirGDB,directory) out_watershed = directory + "\\wshd_" + str(len(temp)) out_watershed_point = directory +"\\wshd_P_" + str(len(temp)) flowDirRaster = dirGDB + "\\fdr" streamRaster = dirGDB + "\\Str" snapStreamRaster = dirGDB + "\\Str" CatchmentFC = directory + "\\Catchment" adjointCatFC = directory + "\\AdjointCatchment" arcpy.CheckExtension("3D") arcpy.CheckExtension("spatial") funcOut2=ArcHydroTools.BatchWatershedDelineation(pairBatch,\ flowDirRaster,streamRaster,snapStreamRaster,\ CatchmentFC, adjointCatFC, "#", \ out_watershed, out_watershed_point)

temp.append("done")

#convert sq ft to sq mi for watershed area, and calculate Sw.Add new fields "Area_sq_mi" and "Streamway_Width" newFields = [("Area_sq_mi", "DOUBLE"), ("Streamway_Width","DOUBLE")] for field, dataType in newFields: arcpy.AddField_management(out_watershed,field,dataType)

#update the new fields uc = arcpy.UpdateCursor(out_watershed)

for row in uc: #DEM cell size is in meter, 1 mi = 1609.344 meter row.Area_sq_mi = row.Shape_Area/(1609.344 * 1609.344) row.Streamway_Width = int(120 * (row.Area_sq_mi ** 0.43)/10)*10 # Round up to 10ft uc.updateRow(row)

del uc

#use JoinField to add "Descript" field to out_watershed arcpy.JoinField_management(out_watershed,"Name",out_watershed_point,\ "Name","Descript") sc = arcpy.SearchCursor(out_watershed) for row in sc: desc = str(row.Name) OriginID = int(desc.split(" ")[1]) TempPntDict[OriginID] = row.Streamway_Width

del sc del batchPnts

diff =(TempPntDict[ID2] - TempPntDict[ID1])/float(TempPntDict[ID1]) return round(diff,2) if __name__ == "__main__": import arcpy,os pair_Batchpoint = arcpy.GetParameterAsText(0) ID1 = int(arcpy.GetParameterAsText(1)) 78 ID2 = int(arcpy.GetParameterAsText(2))

SwDiff = compare(pair_Batchpoint,ID1,ID2) arcpy.AddMessage("The streamway width difference is: " + str(SwDiff))

'''------Module Name: batchPoints.py Author: Ming Sheng Description: Submodule of compareSw.py ------''' def batch_points(basePntFC, pntID): """generate a batchpoints dataset from the subset of points whose ObjectIDs are in the pntID list""" import arcpy,os directory = os.path.dirname(basePntFC) arcpy.env.workspace = directory arcpy.env.overwriteOutput = 1

if len(pntID) == 2: strID = str(pntID[0])+ "_" + str(pntID[1])

if len(pntID) == 1: strID = str(pntID[0])

outFC = os.path.basename(basePntFC) + "_BP_" + strID # the suffix "BP" denotes "BatchPoint" arcpy.CreateFeatureclass_management(directory,outFC,"POINT","#","#",\ "#",basePntFC) batchPntFC = directory + "\\" + outFC

batchPnt_addFields(batchPntFC)

dsc = arcpy.Describe(basePntFC) shapeField = dsc.ShapeFieldName

sc = arcpy.SearchCursor(basePntFC) #create a search cursor for the base point dataset ic = arcpy.InsertCursor(batchPntFC) #create a insert cursor for the batchpoint dataset for row in sc: if row.OBJECTID in pntID: geometry = row.getValue(shapeField) pntObj = geometry.centroid fc = ic.newRow() fc.shape = pntObj fc.Name = "OriginID " + str(row.OBJECTID) fc.Descript = "HydroID " + str(row.HydroID) ic.insertRow(fc)

del sc del ic batchPnt_updateFields(batchPntFC)

return batchPntFC def batchPnt_addFields(batchPnt): """Add other fields to make the batchpoint dataset complete""" import arcpy,os arcpy.env.workspace = os.path.dirname(batchPnt) 79 arcpy.env.overwriteOutput = 1 addFields = [('Name','TEXT'), ('Descript','TEXT'), ('BatchDone','SHORT'),('SnapOn','SHORT'), ('SrcType','TEXT')] for field, dataType in addFields: arcpy.AddField_management(batchPnt, field, dataType)

def batchPnt_updateFields(batchPnt): """Update field:Name,batchDone,SnapOn,SrcType""" import arcpy,os arcpy.env.workspace = os.path.dirname(batchPnt) arcpy.env.overwriteOutput = 1 uc = arcpy.UpdateCursor(batchPnt) for row in uc: #row.Name = "Name" + str(row.OBJECTID) row.BatchDone = 0 row.SnapOn = 1 row.SrcType = "outlet" uc.updateRow(row)

del uc if __name__ == "__main__": import arcpy,os pntFC = arcpy.GetParameterAsText(0) #Input a base point feature class objID1 = arcpy.GetParameterAsText(1) #Input the ID of the first point objID2 = arcpy.GetParameterAsText(2) #Input the ID of the second point objList = [int(objID1),int(objID2)] batchPair = batch_points(pntFC,objList) arcpy.AddMessage("Batch points created: " + batchPair)

B.5 binarySearchBatch.py '''------Tool Name: Search Breakpoints Batch Mode Source Name: binarySearchBatch.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input the order of streams on which the tool will be excuted (e.g. 1, 2, 3, All) (1) Input the subdivision criteria (e.g."0.1", "0.2", etc.) (2) Input the directory where stream vertex feature classes are located

Output: a) Populate the new field "BreakPoint", "Area_sq_mi", "StreamwayWidth" in vertex feature classes b) Feature classes containing breakpoints of stream reaches (e.g.DrL_O1_diss_V1_BreakPnt) c) Polygon feature classes containing delineated watershed (e.g. DrL_O1_diss_V1_wshd) d) Point feature classes containing batch points for watershed delineation (e.g.DrL_O1_diss_V1_wshd_P)

Description: Perform the binary search tool in a batch mode according to user input. Users have the option to perform the search for streams of a single order group. ------'''

80 import arcpy, os from binarySearch import binarySearch order = arcpy.GetParameterAsText(0) #Get the user input of the stream order criteria = arcpy.GetParameterAsText(1) #Get the user specified percentage dir = arcpy.GetParameterAsText(2) #Get the directory of files to be processed arcpy.env.workspace = dir arcpy.env.overwriteOutput = 1 name = "DrL_O" + order + "_diss_V*" vList = arcpy.ListFeatureClasses(name) wshdList = arcpy.ListFeatureClasses("*_wshd*") BPList = arcpy.ListFeatureClasses("*_BreakPnt") sumList = wshdList + BPList percent = float(criteria) if vList: for fc in vList: if not fc in sumList: fullName = dir + "\\" + fc binarySearch(fullName,percent) else: arcpy.AddMessage("Error: The input stream order does not exist in the specified workspace.") arcpy.AddMessage(" Please enter a valid stream order or a correct workspace.")

B.6 split.py '''------Tool Name: Split Stream at Vertices Source Name: split.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input a stream feature class containing dissolved stream reaches of the same order (e.g. DrL_O2_diss, DrL_O3_diss)

Output: a) N feature classes, each of which contains all the segments of one stream reach divided by vertices. N = the number of features in the input dataset.(e.g.DrL_O1_diss_S1_splitLine)

Description: Split a stream reach at its vertices. The output feature class will be used to join the vertex point feature class of this stream reach, in order to transfer the streamway width from the point feature class to stream feature class for mapping purpose. ------''' def split_vertices(streamFC): """split the input streamFC at its vertices""" import arcpy, os directory = os.path.dirname(streamFC) arcpy.env.workspace = directory baseName = os.path.basename(streamFC) arcpy.env.overwriteOutput = 1

81 sc = arcpy.SearchCursor(streamFC) row = sc.next()

while row: ID = row.OBJECTID outFC = directory + "\\" + baseName + "_S" + str(ID) where_clause = '"OBJECTID" = %d'%(ID) arcpy.Select_analysis(streamFC, outFC, where_clause) row = sc.next() del sc

arcpy.env.workspace = directory listFC = arcpy.ListFeatureClasses(baseName + "_S*") for fc in listFC: outSplitFC = directory + "\\" + fc + "_splitLine" arcpy.SplitLine_management(fc,outSplitFC) arcpy.Delete_management(fc)

arcpy.AddMessage("The streams have been split at their vertices.") if __name__ == "__main__": import arcpy stream = arcpy.GetParameterAsText(0) split_vertices(stream)

B.7 joinSw.py '''------Tool Name: Associate Setback Width to Stream Source Name: joinSw.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input stream vertex point feature class with streamway width populated for each vertex(e.g. DrL_O2_diss_V1) (1) Input stream line feature class that is split at vertices (e.g. DrL_O2_diss_S1_SplitLine)

Output: a) A series of stream feature classes, each containing a stream reach that has been divided with streamway width populated (e.g.DrL_O2_diss_S1_Sw)

Description: Join the splitLine stream feature class with the vertex point feature class so that the streamway width can be transfered from point to line for mapping purpose. ------''' def joinSw(pntFC, splitFC): """join the two input to associate stream line with streamway width.""" import arcpy,os directory = os.path.dirname(pntFC) arcpy.env.workspace = directory arcpy.env.overwriteOutput = 1

Fields = arcpy.ListFields(pntFC,"KEY")

#Add a field "KEY" to the vertex FC and use it as join field if not Fields: arcpy.AddField_management(pntFC,"KEY","LONG") 82

sc = arcpy.SearchCursor(pntFC) num = 0 #Count the number of records in pntFC for row in sc: num = num + 1 del sc

uc = arcpy.UpdateCursor(pntFC) #populate the KEY field, KEY starts from 0 row = uc.next() for i in range(num): row.KEY = i uc.updateRow(row) row = uc.next()

arcpy.JoinField_management(splitFC,"OBJECTID",\ pntFC, "KEY", "StreamwayWidth") outFCSw = directory + "\\" + os.path.basename(splitFC)[:-10] + "_Sw" arcpy.Dissolve_management(splitFC,outFCSw,"StreamwayWidth") if __name__ == "__main__": import arcpy vertices = arcpy.GetParameterAsText(0) splitLine = arcpy.GetParameterAsText(1) joinSw(vertices, splitLine)

B.8 batchSplitMatch.py '''------Tool Name: Batch Stream Split and Setback Match Source Name: batchSplitMatch.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input a stream feature class containing connected streams of the same order (e.g.DrL_O1_diss)

Output: a) A series of feature classes containing stream reaches that have been split at vertices (e.g.DrL_O1_diss_S1_splitLine) b) A series of feature classes containing stream reaches that have been divided, with streamway field populated. (e.g. DrL_O1_diss_S1_Sw)

Description: Transfer resulted streamway widths from stream a vertex feature class to its corresponding stream reach feature class in a batch mode. The input is a polyline feature class conaining streams of the same order and merged based on connectivity. ------''' import arcpy, os,split, joinSw streamO1 = arcpy.GetParameterAsText(0) directory = os.path.dirname(streamO1) baseName = os.path.basename(streamO1) arcpy.env.workspace = directory arcpy.env.overwriteOutput = 1 split.split_vertices(streamO1) arcpy.env.workspace = directory streamListS = arcpy.ListFeatureClasses(baseName + "_S*") 83 for fc in streamListS: i = fc.split("S")[1].split("_")[0] vertexFC = streamO1 + "_V" + str(i) splitFC = directory + "\\" + fc joinSw.joinSw(vertexFC,splitFC)

B.8 mergeSw.py '''------Tool Name: Merge Setback Width Source Name: mergeSw.py Version: ArcGIS 10.0 Author: Ming Sheng

Required Arguments: (0) Input the workspace where files to be merged are located. (1) Specify the name of the output file

Output: a) A single feature class containing all the stream reaches in this watershed and each segment has its distinct streamway width.(e.g. SwMerge)

Description: Merge all the files that have a "Sw" suffix to create a single layer of stream reaches in this watershed. Reaches have been divided, each segment having a distinct streamway width. ------''' import arcpy dir = arcpy.GetParameterAsText(0) # Input the workspace where the files are located outName = arcpy.GetParameterAsText(1) #Specify the name of output file arcpy.env.workspace = dir arcpy.env.overwriteOutput = 1

SwList = arcpy.ListFeatureClasses("*Sw") outFC = dir + "\\" + outName if not SwList: arcpy.AddMessage("Error: 'Sw' files do not exist in the input workspace.") elif arcpy.Exists(outFC): arcpy.AddMessage("Warning: The output file name already exists.") arcpy.AddMessage(" Please use another name.") else: arcpy.Merge_management(SwList,outFC)

arcpy.AddMessage("Setback Width Merge completed.")

B.9 clearWspace.py '''------Tool Name: Clear Workspace Source Name: clearWspace.py Version: ArcGIS 10.0 Author: Ming Sheng 84

Required Arguments: (0) Input the workspace that needs to be cleared (1) Input the wildcard reprensenting the feature classes to be deleted before other geoprocessing starts

Output: None

Description: Clear the workspace by deleting certain feature classes with name matching the wildcard. This is to avoid any feature class overwritten problems in later processes, or to delete interim output files to free up the workspace. ------''' def clearWspace(directory, words): """remove feature classes from the given directory""" import arcpy arcpy.env.workspace = directory arcpy.env.overwriteOutput = 1 wildcard = "*" + words + "*" fcs = arcpy.ListFeatureClasses(wildcard) for fc in fcs: arcpy.Delete_management(fc)

arcpy.AddMessage("Feature Classes with a name containing '%s' \ have been deleted."%(words)) if __name__ == "__main__": import arcpy #input the directory of the workspace dir = arcpy.GetParameterAsText(0) #input the words which are in the name of the files to be deleted words = arcpy.GetParameterAsText(1) clearWspace(dir,words)

85