AmericaView Workshop: Introduction to Geospatial Web Services
Sam Batzli - WisconsinView
 
Introduction

With improvements in computing power and public internet access, organizations that archive, maintain, or publish geospatial information are faced with opportunities and challenges for sharing data.

In the last ten years, Web mapping technology has become a realistic option for many medium and large organizations. This workshop will provide an overview of basic map-serving technology options, but will focus on opensource software such as Mapserver and Geoserver.

We will look at how it is possible to publish geospatial information with the WMS and WFS protocols and why one might (or might not) want to do so. We will look “under the hood” at examples from WisconsinView with a special emphasis on optimizing imagery for WMS and GoogleMaps.

This workshop will be more of an overview discussion and demo rather than a technical coding session. Computers will not be provided. Laptops are welcome, but not required.

 
Part 1: Overview of Mapservices
Definition (from http://dictionary.reference.com): "Web map service: noun: a computer program that produces maps of spatially referenced data dynamically from geographic information"

What is wrong with this definition?
...over the Internet?

Why would you want to publish data this way?
(as opposed to shipping CDs, ftp downloads, database access, or hard copy)

Because you can...
...share data 24/7 for "free"
...provide greater access
...offer client independence (if standards-based)
...maintain control of content
...control versioning and updates
...customize access

Why would you not want to publish data this way?

Because of the...
...learning curve
...development time
...technological overhead
...web security
...data sensitivity

Some Examples:
Simple Map - Lake Clarity (direct WMS request from browser)
Satellite Imagery - MODIS Imagery (direct request from browser)
Simple Interface - Wisconsin Lake Clarity (browser interface)
Complex Interface - the National Map (browser interface)

 
Part 2: How do they work?

mapservice diagram

Basic Map Server Model (source: AirAware Project)


mapservice diagram

More Detailed Map Server Model (source: AirAware Project)



Map-service vs Feature-service vs Coverage-service... what's the difference?

  • A map-service delivers content (image or vector GIS data) to the browser or other client as an image -- a snapshot of the data.
  • A feature-service delivers the actual geometry and attributes of vector data to the client (not a browser) -- more dynamic.
  • A coverage-service delivers pixel information for image data providing an opportunity to selectively display band combinations or even classify on the fly.

Two basic approaches to publishing services:

  • cgi - The Common Gateway Interface (CGI) is a standard for interfacing external applications with information servers, such as HTTP or Web servers. A CGI program is executed in real-time, so that it can output dynamic information (Mapserver is an example).
  • deamon or servlet - A deamon or servlet is a computer program that runs in the background on a server, rather than under the direct control of a user; they are usually initiated as background processes and deliver content upon request (Geoserver is an example).

What software choices are there for publishing and viewing?

 
Part 3: OGC - WMS, WFS, WCS

Why Standards?

Here's a scenario: (source: Web Mapping Illustrated pp.216-217)

  • Client: "Good morning. I need a map."
  • Consultant: "Hello. What part of the world are you interested in?"
  • Client: "Pretty much all of North America."
  • Consultant: "Really? All Canada, United States, and Mexico?"
  • Client: "Actually, I'm interested in everything north of the equator."
  • Co: "Okay, that's pretty big. You want all the way to the North Pole?"
  • Cl: "Yes, definitely."
  • Co: "Okay, I'm going to give you a map that goes from the equator to the North Pole, and also covers Newfoundland in the east (50 degrees west) to the border of russia in the west (170 degrees west). How big is the final map going to be?"
  • Cl: "It's going to cover my entire wall from floor to ceiling."
  • Co: "So about eight feet tall?"
  • Cl: "Yes, I guess so."
  • Co: "How wide do you think it will be?"
  • Cl: "Probably half as wide: four feet."
  • Co: "What print resolution are you going to use?"
  • Cl: "Humm, my printer supports up to 150 dpi."
  • Co: "Okay, the image will be about 14,400 pixels high and 7,200 pixels wide. i hope you have lots of space in your email box. This is going to be a bit file! Is there a particular map projection you want to use?"
  • Cl: "I want it to be just like one I already have. Just a second, I'll see what it is. Okay, it says it is Plate Caree. Does that mean anything to you?"
  • Co: "Yep, no problem. I'll just use the EPSG projection code 4326 for the map, same thing. What do you want to see on your map?
  • Cl: "Hummm, the country boundaries, major highways, waterways, and capital cities."
  • Co: "Do you want any special styling for your layers, or should I just use the default way I usually do them?"
  • Cl: "Keep it simple; the usual way is fine."
  • Co: "Okay, I've got those. One last question. What type of image file would you like? I can give you JPEG or PNG."
  • Cl: "JPEG please."
  • Co: "Okay, I'll send you the file in a few seconds."
  • Cl: "Thanks a lot. Talk to you later."
  • Co: "Bye."

How would this happen between a client and a server without standards?

The OGC (Open GeoSpatial Consortium)

"GetCapabilities" request (generates an XML file with the server's mapservice capabilities).

Comparison between "straight call" and "WMS call" -- a.k.a. "GetMap" request

  • http://wms.ssec.wisc.edu/cgi-bin/mapserv?map=/home/wms/data/mapfiles/lakestsi.map
    &layer=LakesTSI&mode=map
  • http://wms.ssec.wisc.edu/cgi-bin/mapserv?map=/home/wms/data/mapfiles/lakestsi.map
    &SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=LakesTSI&SRS=epsg:4326&BBOX=-91.473,45.114,-88.306,46.761&STYLES=&WIDTH=570&HEIGHT=435&FORMAT=image/png&TRANSPARENT=true

WMS Examples

WMS in qGIS

WMS in qGIS

WFS Examples

Lakesat WFS in ArcCatalog

wfs in qGIS

wfs attribute table in qGIS

WCS example: AlaskaMapped

 

 
Details: Looking Under the Hood

How do you configure a Mapservice with Mapserver?

With a "mapfile" (example)

WMS and WFS require metadata tags (example)

 
Clients and Optimization of Imagery


There are many ways to "ingest" a mapservice. We have seen several already:

  • Browsers
  • Simple web interfaces
  • Complex web interfaces
  • GIS Clients (ArcMap, qGIS)

But there are more...

Issues with Imagery...

  • Data Volume (storage)
  • Data transfer (bandwidth)
  • Data processing (delivery)

Some Tips and Tricks...

  • gmap mode or WMS in GoogleMaps v2 and v3 (mobile aware example)
  • Tiling (internal and external)
  • Overviews (internal and external)
  • Caching