Using Web Map Service Data for Visualization and Analysis in Geospatial Applications

thumbsshoesSoftware and s/w Development

Dec 11, 2013 (3 years and 7 months ago)


Reprinted from


2 0 1 0
Using Web Map Service Data for Visualization
and Analysis in Geospatial Applications
By Alan Hwang and Kelly Luetkemeyer
Geographic data sets and base maps are available on the Inter
in ever-increasing numbers, but finding the right data for your appli
cation can be difficult. You may need to sift through hundreds of databases
or download and combine many files to get the necessary coverage. You
may find a Web site with appropriate data only to learn that this data is not
available to the public. The solution to many of these problems is Web Map
Service (WMS), a protocol developed by the Open Geospatial Consortium
for serving geographic data, rendered as a pictorial map, over the Internet.
any government organizations,
including the National Aeronautical and
Space Administration (NASA), the National
Oceanic and Atmospheric Administration

(NOAA), the European Space Agency (ESA),

and the United States Geological Survey
(USGS), use the WMS protocol to provide a
vast array of data to the public. Applications
for available geographic data layers include
atmospheric and ocean studies, oil and gas
exploration, natural resource management,
financial analysis, and urban planning.
You can use Mapping Toolbox™ functions
to find geospatial raster data, render WMS
maps, and visualize and analyze retrieved
data. Here are three examples:

Animating and analyzing time series data

Draping an orthoimage onto a digital
elevation model

Combining data sets
[backdrop, R] = wmsread(bmng);

figure, axesm robinson;

geoshow(backdrop, R);
Animating and Analyzing

Time Series Data
In geospatial applications, it is often neces
sary to model time-varying data sets. The
WMS protocol supports the retrieval of
data for different time periods. This exam
ple shows how to use WMS functionality to
uncover long-term trends in the distribu
tion of sea ice. Visualizing trends in sea-ice
measurements helps climatologists under
stand the effects of climate change on Arctic

marine ecology.
First, we download polar sea-ice mea
surements. The installed database contains
many ice-related data layers. We refine
the search to include animated data, and

Accessing Data from a WMS Server
You can find and display an appropriate
WMS layer with just a few lines of code. For
our sample search, we will find the “Blue
Marble Next Generation, Global MODIS
derived image” or
layer from a server
located at NASA’s Jet Propulsion Labora
tory (JPL). Using the
function in
Mapping Toolbox, we search the installed
database for layers containing a match for
the query string “blue marble.” The result is a
array that contains multiple layers
from multiple servers.
layers = wmsfind('blue marble');

jplLayers = layers.refine('jpl',...


bmng = jplLayers.refine('bmng');
We use the
function to retrieve
the data, rendered as a RGB image.

Reprinted from


2 0 1 0
Figure 1.
September mean sea ice for 1980 (red),
1999 (yellow), and 2004 (green) overlaid on the Blue
Marble image from NASA/JPL. The results show a
reduction of 15% in the sea-ice area over 25 years.
Figure 2.
Mean sea-ice surface area from 1979 to 2004.
Data courtesy NASA/JPL-Caltech.
Reprinted from


2 0 1 0
narrow the results to a layer located at the
NASA Goddard Space Flight Center. The data
set provides measurements of sea ice from
1979 to 2004. Once the layer has been iden
tified, we download the data by nesting the

function in a

loop. This pro
cess creates a 4D matrix of color images

representing the mean sea ice for the month
of September from 1979 to 2004.
By combining the ice data with the Blue
Marble image from NASA/JPL, we can visu
alize the distribution of sea ice at the North
ern polar ice cap with a reference backdrop.
With Mapping Toolbox we align the data
sets for quantitative comparison and create
a Lambert Azimuthal Equal-Area projection
for latitudes 50° to 90°. Sea ice in 1980, 1999,
and 2004 is displayed; the results show how
the sea-ice area has contracted over 25 years
(Figure 1).
The image is informative, but it does not
tell us how much the sea ice has receded
since 1980. To obtain this information, we
use the Mapping Toolbox
tion to calculate the surface area of sea ice.
We plot the result and find that mean sea-
ice levels in 2001 to 2004 are approximately

15% lower than 1980s levels (Figure 2).

A simple linear fit demonstrates this down
ward trend. To perform a more comprehensive
analysis, we could gather more data and create
a model that accounts for seasonal effects.
Figure 3.
Digital elevation model of South
San Francisco. Data courtesy NASA/JPL-Caltech.
Figure 4.
San Francisco orthoimage. Data
courtesy U.S. Geological Survey and retrieved via
Microsoft TerraServer.
Figure 5.
DEM with draped orthoimage.
Draping an Orthophoto onto a
Digital Elevation Model
An orthophoto is an aerial photograph that
has taken elevation, lens distortion, and
camera angle into account so that the scale is
uniform and true distances can be measured.
In this example, we drape an orthophoto
onto a 3D surface rendering of the National
Elevation Dataset (NED), a digital elevation
model (DEM) that provides elevation data in
raster format for the United States and is ac
cessible via WMS. Using Mapping Toolbox,

we retrieve the NED, with customized lati
tude and longitude and image height and
width, and render the map (Figure 3).
We search the installed database for lay
ers from the Microsoft® TerraServer, which
hosts many orthophotos and topographic
maps from the USGS. Once we find an ap
propriate layer, we use the same parameters
to retrieve the map from the WMS server
that we used to retrieve the NED. The or
thophoto is then returned with appro
priate latitude and longitude extents and
resolution. We use the Image Processing

function to display the
image (Figure 4). We combine the ortho
photo and DEM by setting the color data of
the DEM plot as the aerial image. Since the
WMS server has already resized the image
with limits and orientation that coincide
with the DEM data, the surfaces align and
display correctly (Figure 5). With Mapping

Toolbox terrain analysis functionality,
we can further explore the DEM data. For
example, we can calculate a viewshed, an
analysis that reveals which portions of a
landscape are seen by an observer from a
specific vantage point. The
tion assigns a value of 1 to visible areas
and a value of 0 to all other areas. We se
lect the highest point in the DEM data from
which to calculate the viewshed. The result
ing data is visualized in the same manner
used to drape the orthophoto over the el
evation model. This visualization indicates
non-visible areas (Figure 6). Positioning an
observer at the highest point considerably
improves visibility of the area.
Viewshed calculations are important in
many applications. For example, you can
use the
function to place cell
phone towers in locations that have exten
Figure 6.
DEM with draped orthoimage and
viewshed calculations, indicating visibility from
the highest point.
sive coverage. You can then use WMS func
tionality to download population density,
correlate the viewshed with the population
density, and optimize the number of sub
scribers who will have service.
Combining Data Sets
Data obtained via WMS can be combined
with other data sets to yield further insight.
In this example, we combine two WMS data
sets: earthquake frequency and population
density. The result indicates which areas may
be at more risk in the event of seismic activity.
Earthquake data layers contain the fre
quency of earthquakes over a 15-year
period. Figure 7 displays seismic activity

represented by earthquake frequencies
along plate borders. Yellow indicates 1 to
2 earthquakes; orange, approximately 10
earthquakes; and red, 50 to 200 earthquakes.
We combine the earthquake frequency data
with the second data set, estimated popula
tion density in 1995. The population density
is accompanied by a legend, which we dis
play with the layer in Figure 8.
Before combining data sets, we must com
plete two steps. First, we convert the red,
green, and blue channels of the WMS data
layers to intensity. In this example, the data
was returned from the WMS server as a color
image with a legend that indicates the popu
lation density. The
function enables
us to convert an RGB image into an indexed
image based on a color map. We can modify
the resulting indices to match the population
scale of the legend.
Second, we normalize the maximum

value of each data set to 1 so that we can

apply an appropriate weighting when fusing
the images. The population data ranges from
1 to 10,000 people per square kilometer,
while the earthquake data ranges from 1 to
200 earthquakes in 15 years. One approach
to fusing the data sets is to apply a simple
weighted average in locations where both
data sets exist (Figure 9).
We can tune the risk calculation by chang
ing the weighting coefficients for earthquake
frequency or population density. This is the
beginning of a more complicated analysis for
earthquake zones. We can include other data
layers, such as how well structures are re-
inforced, the inhabitants’ earthquake readi
ness, and even the effect of time of day.
When multiple data sets are combined,
the risk analysis becomes a function of sev
eral variables and can more accurately esti
mate the consequences of seismic activity,
such as how many people may be hurt or the
amount of structural damage that the earth
quake will cause.
Looking Ahead
As more organizations share their data over
the Internet, the task of searching, sort
ing, and retrieving the appropriate data
becomes more challenging. Tools that
help find and visualize relevant data layers

enable researchers, engineers, and scientists
to quickly analyze and develop solutions to
problems. Using Mapping Toolbox, we have
demonstrated three examples of how WMS
capabilities support this process by provid
ing data for analysis, supplementing visu
alizations, and producing new insight by

fusing multiple data sets.




Figure 9.
Customized display of earthquake
data based on frequency and population density.
Figure 8.
Population density. Data courtesy
NASA Earth Observations.
Figure 7.
Earthquake frequency along plate
borders. Image courtesy NASA/Goddard Space
Flight Center.
Learn More Online
Learn More Online
© 2010 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See for a list of additional trademarks. Other product or brand names may be
trademarks or registered trademarks of their respective holders.
91843v00 11/10