Essential Fish Habitat ArcIMS Site with Database

Steve Lewis and Jim Noel

This ArcIMS Web site simplifies the process for making informed decisions for Essential Fish Habitat (EFH) by using both spatial and tabular data over the Internet.  EFH means "those waters and substrate necessary to fish for spawning, breeding, feeding, or growth to maturity." Shapefiles and tabular datasets were created by previous authors using combinations of catch and observer data and known science. This ArcIMS/MapObjects Web site and database pull the spatial and tabular data together for an easy and powerful tool for the management of EFH. The Web site can be found at http://www.fakr.noaa.gov/maps


Introduction

In 1996 with the passage of the Magnuson-Stevens Fishery Conservation and Management Act, as Amended, the National Marine Fisheries Service was tasked to identify and describe Essential Fish Habitat (EFH).  EFH has been defined as, "those waters and substrate necessary to fish for spawning, breeding, feeding, or growth to maturity."

By 1998, the National Marine Fisheries Service (NMFS), Alaska Department of Fish and Game (ADF&G), and the North Pacific Fishery Management Council (NPFMC) put together a technical team to assess essential fish habitat. The results were the Fish Habitat Assessment Reports for the species managed under the Fisheries Management Plans (FMPs). These reports included figures that showed the general distributions and known concentrations of approximately ninty five FMP species (split out by life stage, general distribution and known concentrations), and corresponding tables of biological and ecosystem attributes.

Since GIS based geostatical packages were in their infancy, the figures were drawn by hand using georeferenced Catch Per Unit Effort (CPUE) and Trawl Survey data. Later an outside contractor was tasked to create GIS shapefiles from the figures. In this process, they refined the figures by snapping the edges of the newly created shapefiles to bathymetric boundaries. Within the year, a MapObjects Internet Map Server (MO-IMS) EFH site was designed to display the shapefiles.  While it was possible to view information on the species, the site was only a pretty picture.

With the advent of ArcIMS and Esri's Spatial Database Engine, things were about to change. Although MO-IMS had powerful features, the technology was complex and difficult to implement. ArcIMS, on the other hand, provides out-of-the-box basic functionality and with little experience new applications can be built; granted, without SDE or MO, ArcIMS falls short of MO-IMS's potential functionality.

When Judge Zilly issued an injunction to stop all trawling within Steller Sea Lion Critical Habitat (20nm from 151 locations, spread over 1600 nautical mile range, with additional blocks of foraging areas) in Ausgust of 2000, new customized version of ArcIMS sites were required by fishery managers. The ArcIMS sites were designed and customized to increase the Region's toolbag of custom JavaScripts.  These scripts were later used with the EFH ArcIMS site.

Although we tested Java based ArcIMS sites, we found them difficult for even experienced users to install and use. We therefore decided to develop our sites using the standard HTML/JavaScript interface, which did not require the downloading and installation of the Java Runtime Engine (JRE) and Esri's Java Viewer.

Customizing ArcIMS

These custom tools developed for the html viewer included the Can I Fish Here tool, a converter that shows projected metric coordinates to geographic coordinates, an RPA Selector, and a layer lister. The Can I Fish Here tool was based off the Drill_Id tool but in this case drills through the layers and then creates a popup window with hyperlinks to the applicable information and regulations.   We also developed a standalone version for the Steller Sea Lion Protection Measures using Visual Basic and MapObject Lt, which did not require a connection to the Internet.

Figure 1. A view of one of the Steller Sea Lion ArcIMS sites with a popup window showing results from the NOAA Can I Fish Here Tool.

 
The query  form

Next, using script converted from ArcView's Avenue, we customized aimsNavigation.js to convert Alaska Albers coordinates to Latitude and Longitude values.  The new values were used in the the display of mouse-over coordinates, as well as in the Can I Fish Here popup window.

Below is a small section of the function that converts projected coordinates to latitude & longitude.  Note that many variables are easy for IMS administrators to change. Var a represents the semiminor axis of the Earth, var lambda represents the central meridian, var phi1 represents the first reference latitude, and, var phi2 represents the second reference latitude. 

var a = 6378206.4;
var e = 0.0822719; var lambda0 = (-154) * ((2 * Math.PI) / 360);
var phi0 = mapConst * ((2 * Math.PI) / 360);
var phi1 = 55 * ((2 * Math.PI) / 360);
var phi2 = 65 * ((2 * Math.PI) / 360);
var m1 = Math.cos(phi1) / Math.sqrt((1 - (Math.pow(e,2))*(Math.pow(Math.sin(phi1),2))));
var m2 = Math.cos(phi2) / Math.sqrt((1 - (Math.pow(e,2))*(Math.pow(Math.sin(phi2),2))));
var qa = Math.sin(phi1) / (1 - ((Math.pow(e,2))*(Math.pow(Math.sin(phi1),2))));
var qb = 1 / (2*e);
var qc = Math.log((1-(e*Math.sin(phi1)))/(1+(e*Math.sin(phi1))));
var q1 = (1-(Math.pow(e,2))) * ( qa - (qb*qc) );

Another tool allowed fishery managers to select new Steller sea lion protection measures or Reasonable and Prudent Alternatives (RPAs), as defined by the Endangered Species Act, based on Steller Sea Lion Critical Habitat via an ArcIMS site. This site became known as RPA-Select. It was a complex customization of the Select By Rectangle tool (aimsSelect.js). The customization, multiSelect.js, allowed for multiple selections while computing total area in square meters and percent of Critical Habitat selected. The intent of the tool was to reach benchmarks of percent of critical habitat protected. Although the ArcIMS was doing these very difficult calculations, there were complaints that the RPA-Select tool was slow and unresponsive. In actuality, a fishery manager could select an RPA based on over 360 billion square meters within two to four minutes. As the number of layers continued to grow, as with the EFH site, it became necessary to group the layers for ease of sorting and usability.

The following is a small section of the JavaScript code from multiSelect.js, which calculates the total area of all selected features and then calculates the proportion of this area to the total area of all features in the layer:

function addAreas() {
  cumArea = 0;
  for (var i=0; i<selectfeature.length; i++)
  if (selectFeature[i]) {
    cumArea += selectFeatureArea[i];
    propArea = cumArea/totalArea;
  }
}

We also wanted to make our code available to other NOAA sites. We kept our customizations easy to adopt by other ArcIMS sites. We soon found that developers not just from NOAA but from around the world were interested in our customizations. A simple zip file containing the customized javascript and htm files with easily changeable variables could implement our technologies on any ArcIMS within minutes after receiving the zipped files.



Creating the Database

Our next task was to overhaul the EFH site by attaching a database of attributes. The problem was that there was no database, only sets of Excel and WordPerfect tables that had been created for the Fish Habitat Assessment Reports.

Figure 2 An excerpt of the Excel table for groundfish habitat associations in the Bering Sea, Aleutian Islands, and the Gulf of Alaska

Original Excel  habitat table

These tables had to be put into a form that could be imported into a database, so the columns of the tables had to be made compatible with available field types in the database. For example, most of the columns in the table indicate whether the organism is associated with a particular habitat feature. An "x" indicates that the creature has been observed (or caught) in locations having that characteristic, while a blank cell indicates no association with the feature. This type of information corresponds naturally to a boolean data type, so the corresponding fields in the database were defined as boolean fields, and the cells in the spreadsheet were converted from blanks and "x" values to the boolean values FALSE and TRUE, for importing into the database.

In addition to the groundfish habitat associations table illustrated above, there were also habitat association tables for crab and salmon species. These tables were fairly similar to the groundfish table, but differed in terms of which fields were present. For example, the salmon table included a field for "Freshwater", which was not found in the groundfish table. To create a habitat association table that could accommodate all fisheries, it was necessary to pool the fields from all tables together into a single table definition.

After this generalized habitat table was defined, the various Excel tables were imported into it.

Figure 3 Imported table in Microsoft Access Database.

MS Access  habitat table

(The fields with checkboxes under them are boolean fields, and the checkboxes are an alternate way of displaying boolean fields in Microsoft Access.) Additional tables for biological attributes, reproduction, diet and information levels were developed in similar fashion.

Figure 4 Summary of the central tables of the EFH database, and illustrating the relationships between them:

Table relationships



Linking the Database with the Website

With the database ready, it was time to link it up with the ArcIMS website by incorporating Active Server Pages (ASP). To make the database accessible to ASP, an Open Database Connectivity (ODBC) connection to the Microsoft Jet engine was set up.

Using the field names and values from the EFH database, a query form in ASP was developed to allow users to select data from the database satisfying a wide variety of possible conditions. The user sets selection criteria by highlighting attributes in various select boxes. The user could also specify which fields were displayed in the results table. The entry point into this query form was the Query button on the Toolbar frame of the ArcIMS viewer, which was modified to point to this form in place of the JavaScript procedure that was originally used.

Figure 5. A screen shot of the query form

Query form

After the user sets the selection criteria and clicked the Submit, the selection criteria is forwarded to a second ASP page, which formed an SQL query from the selection criteria and sent this query to the database via the ODBC connection. The data returned by the ODBC connection was then displayed on the ASP page in tabular format.

Figure 6. A screen shot of the tabular results

Query results

Additionally, the Map Frame of the ArcIMS Viewer was redrawn, using the Species and Life Stage values returned by the query to determine which ArcIMS Species/Life Stage layers to display.

The MapFrame update is accomplished by the following JavaScript code. This is found at the end of the query submit ASP file:

t = window.opener.parent.MapFrame;
LayerIDstr = window.document.forms(0).item("theLayerIDs").value;
groupQueryString = window.document.forms(0).item("groupQueryString").value;
theLayerIDs = LayerIDstr.split(",");
if (LayerIDstr != "") {
  for (var i= 1;i<(t.LayerVisible.length-3); i++)
    t.LayerVisible[i] = 0;
  for (var i=0; i t.LayerVisible[theLayerIDs[i]] = 1;
    t.focus();
  t.sendMapXML();
}

Figure 7: ArcIMS Viewer shot after query.



 

Viewer after  query

The limitation on the site was that it performed a total redraw of the corresponding shapefiles rather than just returning the specified query. For example, if you queried Atka Mackerel AND a depth of less then 200 meters, it would include the total Atka Mackerel layer rather than just Atka Mackerel in waters less then 200 meters deep.

Development using SDE

The new site, currently in development, uses SDE and will allow these types of on-the-fly geometric operations such as intersections and unions. ArcSDE is essentially a front-end to a database management system that allows geometric features to be included as fields (Shape fields) in database tables, and knows what to do with them. Each row in the table has a particular feature in its Shape field, and the table can be queried to return a specific subset of features from the table, just like an ordinary query. But aside from its database management abilities, ArcSDE also includes a number of powerful tools for working with shapes, including geometric operations like unions and intersections.

Unfortunately, it is not easy to access these sophisticated functions from ArcIMS. ArcIMS can get pre-existing, named layers from ArcSDE, but it has no means of directly invoking ArcSDE methods. However custom connectors can be built with application-programming interfaces (API). There are two (API) available for ArcSDE: one for C++ and one for Java. We chose Java and began writing a JavaBean to perform geometric operations from a Java Server Page (JSP). The JSP, which we run under Allaire's JRun, is then called from ArcIMS.

The following section of code from the Javabean uses SDE to intersect a shape with a shape, to create a new shape:

Shape1 = (SeShape)fList1.get(I);
Shape2 = (SeShape)fList2.get(J);
newShape = Shape1.intersect(Shape2);
if (newShape != null)
  for (int index= 0;index < newShape.length; index++)
    newList.addElement(newShape[index]);

Using GeoStatistics for Essential Fish Habitat

Working with the Essential Fish Habitat team, we are using GeoStatistical Analyst to create polygons from the general distributions and known concentration of the FMP species. We are using the same data types as when the original figures were drawn: Catch Per Unit Effort (CPUE) and Trawl Survey data averaged over a five-year period. The Trawl Survey data was processed with CPUE. The resulting TSCPUE data was further normalized by dividing TSCPUE by the Sum TSCPUE for a new attribute column: PPPP.

Using attributes from TSCPUE, GeoStatistical Analyst was put into action. The data was explored using the exploration tools to find trends and test for normal distributions and find the correct parameters for the geostatical methods.

Figure 8. Histogram of PPPP

Histogram

Although the analysis is not complete, Kriging appears to provide a good algorithm for the creation of new EFH species layers. Using the GeoStatistical Analyst, we used Orindary Kriging with a logarithmic transformation and a second order (parabolic) trend removal.  We hope to use these tools to find known concentrations and general distributions of species, 75 percent and 95 percent respectively.  We will also be validating the surface by creating subsets of the data; GeoStatistical Analyst provides useful validation tools for this purpose. 

Figure 9. Result of Ordinary Kriging on Alaska Plaice's PPPP Attributes.

Histogram

Conclusion

GIS tools such ArcIMS, ArcSDE, and Geostatical Analyst have enabled us to develop powerful new GIS tools for the Internet for the exploration of management alternatives for the conservation of Essential Fish Habitat.


References/Acknowledgements

1999 EFH Core Team  and Recent Contributors David Witherell, Lowell Fritz, Cindy Hartmann, Steve Waste, Jeff Short, Mike Murphy, Jeff Fugioka, Matt Eagleton, and Tamra Faris.

Technical Team from 1998 Assessment Reports  Dave Clausen, Matte Eagleton, Lowell Fritz, Jeff Fugioka, Anne Hollowed, Dan Ito, Sandra Lowe, Tory O'Connel, Michiya Shima, Grant Thompson, Vidar Wespestad, Tom Wilderbuer, Bruce Wing, and David Witherell.

Other Contributors:

ADF&G:   Tory O'Connel, Gordon Kruse, Ivan Vining, Peggy Murphy, Fritz Funk, Doug Pengilly, Al Spalinger, Rance Morrison, Dan Urban.

NMFS:  Rebecca Reuter Angie Grieg, Jon Heifetz, Jerry Reeves, Bob Otto, Dave Clausen, Anne Hallowed, Dan Ito, Sandra Lowe, Michiyo Shima, Grant Thompson, Vidar Wespestad, Tom Wilderbuer, Bruce Wing, Bill Heard, Jacke Helle, Mitch, Lorenz, Mike Murphy, Jerry Taylor, Alex Wetheimer, Jim Thomas, Bob Stone, Chuck O'Claire, Kim Rivera, and Cyries Schmidt. 

IPHC:    Bob Trumble and Laurie Saudoris

University of Alaska:   Tom Shirley

Resource Data, Inc.   Marshal Kendziorek and Rick Pannell

Other Recent Contributors

        NMFS:  John Olson

        ADF&G  Kristin Mabry


Authors


Steve G. Lewis
GIS Coordinator/Analyst
NOAA Fisheries
Alaska Region
709 West 9th Street
P.O. Box 21668
Juneau, Alaska 99802
Steve.Lewis@noaa.gov
Fax: (907)586-7255
http://www.fakr.noaa.gov/maps

Jim Noel, Programmer/Consultant
Jim Noel Development Solutions
17430 Andreanoff Way
Juneau, AK 99801
Phone: 907-789-4656
e-mail: jnoel@gci.net