About | Contact | SUBMIT PRESS | Advertise | FAQ
Spatial Newsletters | Twitter |
HomeNewsArticlesExpertsDataJobsEDULBSSTOREEVENTSDirectoryBLOGSocialPHOTOS
Software | Spotlights on Geospatial Data | Web Services | Mashup Zone | IMAGING | Hardware | Social Media  
advertisement

Top Geo News
Put Your PR here!
Social Connect



vimeostumble
Facebook

GISuser Sponsor


Recent Site Additions
Featured Video


GISuser TOP 10 Viewed Videos
More Photos and Videos

GIS Job Opportunities
 

Loads of GIS Jobs!

Marketing Writer - Professional Services
Software Technical Lead
Web Applications Developer, Washington, D.C.
Lead Developer – Kelowna (KE01-12)
GIS Consultant
GIS Coordinator
Solutions and Support Specialist
GIS Director
GIS Analyst - Two Positions
GIS Mapping Specialist

GISuser Sponsor

Directory
MarkeTech 
Category: Geo Tech Companies & Consultants


GISuser Sponsor


AnyGeo - Anything Geospatial

↑ Grab this Headline Animator

Home arrow Articles arrow Web Services arrow Earthquake Mapping with OGC and Open Source Tools     

HOT Articles
Salary Survey of GIS Professionals and How We Stack Up Against Others in Our Occupation
HOT Careers and Training
  Technical Analyst - Energy/Utilities, Washington, D.C.(Esri)
GIS Project Manager, St. Louis (Esri) / JavaScript/HTML 5 Developers, VA
post a GIS job
Submit Your GIS/Geo News/PR to GISuser
Earthquake Mapping with OGC and Open Source Tools  E-mail
Written by Tom Kralidis   
12 May 2005
One thing I've always found useful about USGS website is the neat "latest earthquakes" listing given each day. So one day I said to myself, "boy, wouldn't it be great if this type of information were available as a map for users to embed in their application?" 

The Open Geospatial Consortium (OGC) produces specifications web mapping, geographic information and processing. Perhaps the most used to date is the Web Map Service specification, which defines a common interface to interact with a server's geographic data through visualizations of maps. The Web Feature Service allows for users to access raw, actual data in Geography Markup Language (GML), which is an open XML format for geospatial data. Using common standards allows for maps and data to be delivered as "services", as opposed to static data download. This lets applications developers connect to geospatial data dynamically and fetch for a given area of interest, temporal slice, or attributional query.

There are many software tools which support the WMS specification. The neat thing about common standards is that servers can communicate with eachother regardless of what kind of software is used a given organization. In this particular example, I've chosen to use the University of Minnesota MapServer software. MapServer supports a number of OGC specifications, and can be run on a number of given operating systems. In addition, MapServer is free, open source software.

So, what I'm going to do is use MapServer to serve the latest earthquake data through a WMS server. Here are the steps involved:

  • use Perl script to format the data to GML
  • configure mapfile to serve GML as a WMS layer
  • add reference layers through WMS
  • publish URL

Data Formatting

MapServer accepts a number of different geospatial data formats, including GML. I wrote a quick Perl script which fetches the remote ASCII records from the USGS website and converts them to GML as a format MapServer, and any GML aware software, can work with. The neat thing about the output GML is that, as an XML format, it is interoperable and self-describing, which means applications which support GML can work with this data. Also, any XML processor can work with and process this data. Nice!

MapServer also works with shapefiles as input. Shapefiles are a binary encoded set of files which store geospatial data. Shapefiles are useful when GML becomes too large to work with. Since this is a small dataset, GML is a nice, application neutral, human readable file format to work with. GML can be thought of as a data transfer format over the Internet. We'll see later how MapServer can read a shapefile as a WFS and return GML on the fly. The Perl script to generate a shapefile is very similar to GML, except that we use Mapscript, a module which exposes MapServer functions in a number of languages, such as Java, PHP, and, in this case, Perl.

As the source data changes with time, I've opted to schedule a process to run every 10 minutes to freshen the data.

Mapfile Configuration

MapServer provides a CGI standalone process which is driven by a configuration file, called a "mapfile". Mapfiles contain layer information, data connections, area of interest, and so on.

So I wrote the mapfile to point to the output GML data. The mapfile is setup to act as an OGC WMS and OGC WFS.

At this point, any WMS client can make a request to MapServer as a WMS and have a map of the earthquakes returned to them. Here's a sample GetMap request:  

http://host/cgi-bin/mapserv/mapserv?map=/home/tkralidi/|config.map&service=
WMS&version=1.1.1&request=GetMap&format=image/png&width=500&height=300&srs=
EPSG:4326&layers=neis&bbox=-180,-90,180,90&styles

and here is the image which is returned by the URL:

At this point, any WMS client can connect to this data and integrate into their application with other data.

MapServer also acts as a WMS client, which means MapServer itself can connect to other WMS services and fetch maps for you, which you can return to your client. So the next step we take is to add some reference layers (imagery, political boundaries, coastlines). These reference layers themselves come from remote WMS servers. Here's a GetMap request which shows the earthquake data atop the reference data:

http://host/cgi-bin/mapserv/mapserv?map=/home/tkralidi/config.map&service=
WMS&version=1.1.1&request=GetMap&format=image/png&width=500&height=300&srs=
EPSG:4326&layers=envisat_meris,polbnd,coast,neis&bbox=-180,-90,180,90&styles

and here is the image returned by the URL:

Pretty neat and not alot of effort! One can make this as simple or as complex as they wish. The most simple thing to do is to add this as an HTML image tag in your webpage:

IMG height=300 alt="[ recent earthquakes ]" 
src="http://host/cgi-bin/mapserv/mapserv?map=/home/tkralidi/config.
map&service=WMS&version=1.1.1&request=GetMap&format=image/png&width=
500&height=300&srs=EPSG:4326&layers=envisat_meris,polbnd,coast,neis&bbox=
-180,-90,180,90&styles=" width=500 border=0

I've included the Perl script and sample mapfile for download.

Links

Thanks to Tom for this cool submission! You can contact him for comments at tomkralidis-at-hotmail-dot-com - More about Tom HERE

Last Updated ( 18 May 2005 )
 
< Prev   Next >

Submit Your GIS/Geo News/PR to GISuser



Search the Spatial Media Web Resources
blog comments powered by Disqus
HOT Video
ILMF12 Video of 3D GeoPDF With TerraGo Technologies
 

deliciousrssnewsletterlinkedinfacebooktwitter

More GISuser Features

feature articlesSee more GISuser Features HERE / See GISuser Spotlights Here

AnyGeo - Geospatial Updates from Glenn

↑ Grab this Headline Animator

Recent Directory Listings
1. Mobileize
    Category: POI, Local Search and Data Providers
    Created: Feb 3, 2012
2. Dogsly
    Category: Photography Apps and Tools
    Created: Feb 3, 2012
3. Position Logic
    Category: Location Based Services (LBS)
    Created: Feb 2, 2012
4. Telogis Dev
    Category: Developer Programs
    Created: Jan 31, 2012
5. Dot Com Infoway
    Category: Mobile App Development
    Created: Jan 25, 2012
Show more...
Featured Events
  • Esri devMeetUps - locate a developer meetup taking place in a city near you
  • ERDAS Webinars - Register for a free, online webinar from ERDAS
  • ILMF 2012 - International LiDAR Mapping Forum, Denver, Colorado, Jan 23-25, 2012
  • Esri Dev Summit - The Esri Developer Summit (DevSummit) brings together developers and GIS professionals from all over the globe. March 26-29, 2012, Palm Springs, CA
  • Where2.0 - where the people working on and using location technologies come together to explore best practices and emerging trends in software development, tools, business strategies, and marketing. April 2-4, 20112, San Francisco, CA

 List Your Event Here 

2X A Week Newsletter

See Recent edition
newsletter

subscribe GISuser

We won't share your address!
Sponsor

Popular Stuff!


RSS and Feeds

Software

software reviews
Geo Technology Software

GISuser Site Sponsor


Most Popular
GISuser HOT Spots!

Google Mashup Zone
GISuser WebMaps
Free Data Articles
Spotlights & Tips
GISuser Resumes
Data Links
10 Cool Things
The LBS Zone!

GISuser RSS Feed
Partner Sites


lbszone.com


symbianone

A Spatial Media LLC property

 




Spatial Media, LLC ©2003 - 2011 All rights reserved / Privacy Statement