4
211 Banding Birds with MapServer CGI By Robert S. Wardwell and Kevin W. Laurent U.S. Geological Survey Cascades Volcano Observatory 1300 SE. Cardinal Court, Bldg. 10, Suite 100 Vancouver, WA 98683 Telephone: (360) 993-8908 Fax: (360) 993-8980 e-mail: [email protected] U.S. Geological Survey Patuxent Wildlife Research Center 12100 Beech Forest Rd. Suite 4034 Laurel, MD 20708 - 4034 Telephone: (301) 497-5652 Fax: (301) 497-5826 e-mail: [email protected] Since its establishment in 1936 as the nation’s first wildlife experiment station, the USGS Patuxent Wildlife Research Center (PWRC) in Patuxent, Maryland, has been a leading international research institute for wildlife and applied environmental research. A primary goal at the PWRC Bird Banding Laboratory (BBL) is to manage the administration of bird banding permits, coordinate banding efforts, and collect data scientists can use to analyze such things as species behavior, migratory patterns, and the overall health of a species. Recently, computer scientists at the BBL have developed an ORACLE based permitting and banding administration system focused on tracking a wide range of data about banded birds and managing the BBL bird banding efforts (Figure 1). One component of this system relies on MapServer, an open source Web mapping solution, to collect an absolutely crucial set of data: the geographic location where a banded bird is encountered or recovered in the field. This paper describes how the BBL uses MapServer to collect scientific data and provides some insight into implementing MapServer. MapServer was originally developed by the Uni- versity of Minnesota ForNet project in cooperation with NASA and the Minnesota Department of Natural Re- sources. Presently, the MapServer project is hosted by the TerraSP project, a NASA sponsored project between the UMN and consortium of land management interests. MapServer has become a popular tool by which to render spatial data such as vectors, maps, and images to the Web. The MapServer Website http://mapserver.gis.umn.edu/ is a valuable resource for learning more about MapServer. MapServer’s role in the BBL permitting and band- ing administration system is to generate interactive maps used to plot and record a geographic location where a bird was encountered or recovered. These data are currently captured at USGS call centers in Patuxent, Maryland, and Walla Walla, Washington, where reports are made when a banded bird is encountered or recovered in the field. USGS call center employees ask the caller to describe the bird’s location and then use an interactive map to find the location and record the approximate coordinates. First, the caller describes a location using a common feature name, such as the name of a town, landmark, park, or water feature (Figure 2). Next, the BBL call center queries the system to search for the location in a feature names gazet- teer that contains millions of common feature names in the US and abroad. Finally, MapServer is called upon to render an interactive map of the selected area, with tools that allow the call center employee to record the location where the bird was encountered (Figure 3). Since every caller is not equipped with a GPS or map, MapServer makes it possible to utilize the caller’s relative proximity to known geographic features and calculate an accurate longitude and latitude values for their location. Prior to using MapServer, these geographic data were collected by the BBL as a pair of vectors showing a spa- tial relationship between a known geographic feature and the location where a bird was encountered or recovered. For example, a banding encounter may be described as being “2 miles east and 3 miles north of Camas, Washing- ton.” These descriptions could be intersected and plotted within a mesh of 10 minute grid cells to add more quanti- tative measure to the data. This approach, however, led to

Banding Birds with MapServer CGI - U.S. Geological Survey ... · 211 211 Banding Birds with MapServer CGI. By Robert S. Wardwell and Kevin W. Laurent. U.S. Geological Survey Cascades

  • Upload
    buitruc

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Banding Birds with MapServer CGI - U.S. Geological Survey ... · 211 211 Banding Birds with MapServer CGI. By Robert S. Wardwell and Kevin W. Laurent. U.S. Geological Survey Cascades

211

211

Banding Birds with MapServer CGIByRobertS.WardwellandKevinW.Laurent

U.S.GeologicalSurveyCascadesVolcanoObservatory

1300SE.CardinalCourt,Bldg.10,Suite100Vancouver,WA98683

Telephone:(360)993-8908Fax:(360)993-8980

e-mail:[email protected]

U.S.GeologicalSurveyPatuxentWildlifeResearchCenter12100BeechForestRd.Suite4034

Laurel,MD20708-4034Telephone:(301)497-5652

Fax:(301)497-5826e-mail:[email protected]

Since its establishment in 1936 as the nation’s first wildlifeexperimentstation,theUSGSPatuxentWildlifeResearchCenter(PWRC)inPatuxent,Maryland,hasbeenaleadinginternationalresearchinstituteforwildlifeandappliedenvironmentalresearch.AprimarygoalatthePWRCBirdBandingLaboratory(BBL)istomanagetheadministrationofbirdbandingpermits,coordinatebandingefforts,andcollectdatascientistscanusetoanalyzesuchthingsasspeciesbehavior,migratorypatterns,andtheoverallhealthofaspecies.Recently,computerscientistsattheBBLhavedevelopedanORACLEbasedpermittingandbandingadministrationsystemfocusedontrackingawiderangeofdataaboutbandedbirdsandmanagingtheBBLbirdbandingefforts(Figure1).OnecomponentofthissystemreliesonMapServer,anopensourceWebmappingsolution,tocollectanabsolutelycrucialsetofdata:thegeographiclocationwhereabandedbirdisencountered or recovered in the field. This paper describes how the BBL uses MapServer to collect scientific data and providessomeinsightintoimplementingMapServer.

MapServerwasoriginallydevelopedbytheUni-versityofMinnesotaForNetprojectincooperationwithNASAandtheMinnesotaDepartmentofNaturalRe-sources.Presently,theMapServerprojectishostedbytheTerraS�Pproject,aNASAsponsoredprojectbetweentheUMNandconsortiumoflandmanagementinterests.MapServerhasbecomeapopulartoolbywhichtorenderspatialdatasuchasvectors,maps,andimagestotheWeb.TheMapServerWebsitehttp://mapserver.gis.umn.edu/isavaluableresourceforlearningmoreaboutMapServer.

MapServer’sroleintheBBLpermittingandband-

ingadministrationsystemistogenerateinteractivemapsusedtoplotandrecordageographiclocationwhereabirdwasencounteredorrecovered.ThesedataarecurrentlycapturedatUSGScallcentersinPatuxent,Maryland,andWallaWalla,Washington,wherereportsaremadewhena banded bird is encountered or recovered in the field. USGScallcenteremployeesaskthecallertodescribethebird’s location and then use an interactive map to find the locationandrecordtheapproximatecoordinates.First,thecallerdescribesalocationusingacommonfeaturename,suchasthenameofatown,landmark,park,orwaterfeature(Figure2).Next,theBBLcallcenterqueriesthesystemtosearchforthelocationinafeaturenamesgazet-teerthatcontainsmillionsofcommonfeaturenamesintheUSandabroad.Finally,MapServeriscalledupontorenderaninteractivemapoftheselectedarea,withtoolsthatallowthecallcenteremployeetorecordthelocationwherethebirdwasencountered(Figure3).SinceeverycallerisnotequippedwithaGPSormap,MapServermakesitpossibletoutilizethecaller’srelativeproximitytoknowngeographicfeaturesandcalculateanaccuratelongitudeandlatitudevaluesfortheirlocation.

PriortousingMapServer,thesegeographicdatawerecollectedbytheBBLasapairofvectorsshowingaspa-tialrelationshipbetweenaknowngeographicfeatureandthelocationwhereabirdwasencounteredorrecovered.Forexample,abandingencountermaybedescribedasbeing“2mileseastand3milesnorthofCamas,Washing-ton.”Thesedescriptionscouldbeintersectedandplottedwithinameshof10minutegridcellstoaddmorequanti-tativemeasuretothedata.Thisapproach,however,ledto

Page 2: Banding Birds with MapServer CGI - U.S. Geological Survey ... · 211 211 Banding Birds with MapServer CGI. By Robert S. Wardwell and Kevin W. Laurent. U.S. Geological Survey Cascades

212 D�G�TALMAPP�NGTECHN�QUES‘06

Figure 1.Screenshotofthebandingmanagementinterfacedisplaysadatainputformwhereinformation is collected about birds that are encountered in the field. A geographic search is initi-atedinthemiddleframe,whichopenstheMapServerinterfaceintherighthandframeoftheWebbrowser. The user identifies the location of the bird encountered by plotting it on the interactive map.Latitudeandlongitudecoordinatesarepassedbacktothemaindataentryforminthecenterofthepage.SubmittingtheWebformrecordstheevent.

Figure 2.AplacenamesearchgeneratesalistofpossiblenamematchesbeingreturnedintheGazetteer resultslist.SelectingaplacenamefromthelistpassesthefeaturenamecoordinatestoMapServer,whichreturnsamapcenteredontheselectedlocation.

alargedegreeofinaccuracy.Now,withtheaidoffeaturerichmapsrenderedbyMapServer,geographiclocationmaybecommunicatedmoreeffectivelyandmoreaccu-ratedataisstoredascoordinatepairsintheBBLdatabase.

ThemapsgeneratedbyMapServercontainaselec-tionofglobalandnationalspatialdatalayers.Theselayersincludecommonlandmarks,hydrology,urbanareas,transportationroutes,wildliferefuges,andparksfortheUnitedStatesalongwithGlobalpoliticalboundariesandpopulatedplacesfortheentireglobe.Alsoincludedaretransportationroutes,hydrology,wildliferefuges,andparksforCanadaandMexico.MapServeriscapableofservingbothrasterandvectordatainamultitudeofformats.Vectordatasources,forexample,mayincludeESRI shapfiles, PostGIS, ESRI ArcSDE, Oracle Spatial, MySQL.FortheBBLbandingapplication,basemapdatawere downloaded from the Web in ESRI shapefile format. FeaturedatafromtheUSGSGeographicNames�nforma-tionSystem(GN�S),NaturalResourcesofCanadaGazet-teer,andtheNationalGeospatialAgency’sGeographicNames System (NGA GNS) were made into shape files, whichmadeitpossibletosearchforandlabelover3mil-lionfeaturesonthemaps.Quadtreebasedspatialindexing

Page 3: Banding Birds with MapServer CGI - U.S. Geological Survey ... · 211 211 Banding Birds with MapServer CGI. By Robert S. Wardwell and Kevin W. Laurent. U.S. Geological Survey Cascades

213BAND�NGB�RDSW�THMAPSERVERCG�

Figure 3.TheinteractivemapcreatedbyMapServercontainstoolsusedtozoomin,zoomout,pan,andmarkapointonthemap.�ntheaboveexample,theuserhaszoomedinandclickedonthemap,whichplacesan“xmarksthespot”symbolatthelocationwhereabirdwasencountered.MapServercalculatesthecoordinatesofthepointwhichisthensubmittedtothedatabase.

Figure 4.Themap file (.map extension) is a text file createdmanuallyorbuiltusingoneofmanyopensourcetools. This file describes the data sources for your map and defines the map extent, data layers, symbols, and layer classification.

of each shape file was performed using the MapServer shptreeutility,whichhelpsspeedthedeliveryofmapdataovertheWeb.

�ntheBBLbandingapplication,MapServeroperatesasaCG�programthathandlesrequestsandresponses.Themapandeverythingaboutthelayerswithinthemap,such as cartographic symbols and the classification of the layers,arecontrolledthroughaMapServermap file. This file is a hierarchical text file with a .map extension that describeseachofthedatalayerstobeincludedinthemap,anddescribeshoweachlayeristoappear(Figure4).Theinteractivemappinginterface,whichcontainstoolsusedtozoom,pan,orplotthelocationofabandedbirdencounter,is controlled by an HTML and JavaScript template file. The template file contains unique CGI variable tags, which arehandledbyMapServereachtimetheusermakesare-questforanewmap(Figure5).ThemapitselfisrenderedontotheWebpageasastaticimage,suchasa.gif,.png,or.jpgthatisreplacedwhenMapServerprocessesanewsetofinputparametersfromtheHTMLtemplate.

WhentheBBLpermittingandbandmanagementapplicationwenttoproductionuseinMarch2006,the

mappingcomponentcontainedover50datalayers,whichincludeddatafor3.6millionnamedpointsinmorethan50countries.MapServerproveditselfworthybyhandlingthese large datasets and displaying them efficiently over the�nternet.Furthermore,wefoundMapServertobeasimple,elegantsolutionforimprovingthedataacquisitionattheBBL.Thesuccessofthisprojectcanbeattributedtothecollaborativeeffortsofbiologists,computerscien-tists,andG�Sprofessionals,alongwiththeopensourcedevelopmentcommunitysurroundingMapServer.

REFERENCES

Kropla,B.,2005,BeginningMapServer-OpenSourceG�SDe-velopment:ApressPublishing.

Lime,S.,(fromtheMapServerWebsite),2006,WelcometoMapServer,accessedathttp://mapserver.gis.umn.edu/.

Mitchell,T.,2005,WebMapping�llustrated-UsingOpenSourceG�SToolkits:O’ReillyPublishing.

PatuxentWildlifeResearchCenterWebsite,2006,PatuxentWildlifeResearchCenter–Mission:accessedathttp://www.pwrc.usgs.gov/aboutus/mission.cfm.

Page 4: Banding Birds with MapServer CGI - U.S. Geological Survey ... · 211 211 Banding Birds with MapServer CGI. By Robert S. Wardwell and Kevin W. Laurent. U.S. Geological Survey Cascades

214 D�G�TALMAPP�NGTECHN�QUES‘06

Figure 5. The HTML template file defines a map interface that can be customized and enhanced with JavaScript. The MapServer CGI program will process your map file and pass values to “sub-stitutionstrings”thatareenclosedinsquarebrackets(‘[]’).TheCG�variableexamplesinthiscodesnippetincludemap,mapext,zoomdir,zoomsize,layers,andimg.