Transcript
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.


Recommended