Kamis, 27 Januari 2011

Creating a time-enabled WMS with ArcGIS Server 10

The much-requested ability to show time in a WMS is now available at ArcGIS Server 10.0. A time-enabled WMS advertises a temporal extent of its layers in the GetCapabilities response, just as it does for the spatial extent. A client can 'zoom' the map to a particular point in time using a 'TIME' parameter in the GetMap request. This post shows an example of a time-enabled WMS and describes how it was built.

Preparing the data


To get a time-enabled WMS, your data has to have some temporal information associated with it. Temporal data can theoretically be stored within raster data or it can be associated with vector features in an attribute field. With ArcGIS Server, you can only publish a time-enabled WMS from a map service (as opposed to an image service), so we’re just going to focus on vector data for this example.


The test dataset we’ll use are some point and line features in Port-au-Prince, Haiti, collected from the Open Street Map (OSM) database. OSM is a crowdsourced geographic database into which any editor can contribute data. Before the January, 2010 earthquake in Haiti, OSM didn’t have much coverage of Port-au-Prince. Here’s what it looked like:


OSM before Haiti edits
(C) OpenStreetMap and contributors, CC-BY-SA


After the earthquake, volunteers quickly digitized data for the Port-au-Prince area to provide more accurate maps for responders on the ground. In a few weeks, the dataset grew into quite possibly the most complete and accurate GIS dataset of Port-au-Prince that has ever been compiled.


OSM after Haiti edits
(C) OpenStreetMap and contributors, CC-BY-SA


To better visualize this amazing power of crowdsourcing, I decided to build a WMS that shows the growth of OSM in Haiti during the days following the earthquake.


The original data I downloaded from Geofabrik was a snapshot from January 25, 2010. This was only two weeks after the earthquake, so if you download the data now, you’ll get an even more recent snapshot. A nice perk of the site is that it offers the OSM data in Esri shapefile format. For this example, I decided to download streets, waterways, and points of interest.


Here's an example of the attribute table for the streets layer. The highlighted field 'timestamp' contains the time the feature was submitted into the OSM database. All the layers I downloaded have a similar 'timestamp' field.


Timestamp field in ArcGIS


Configuring time settings in the ArcMap document


Before publishing the map document through ArcGIS Server, you need to enable time settings on each layer in ArcMap. This involves opening the layer properties and telling your map which field holds the time information that should be used for that particular layer. Here’s an example screenshot for the streets layer:


Enabling time on a layer


To get here, I just right-clicked the streets layer in the ArcMap table of contents and clicked Properties. Then I clicked the Time tab, which is new at ArcGIS 10.


Here are some of the settings I adjusted:



  • Layer Time – This specifies whether a feature in the layer is associated with a single time point (defined by one attribute field) or a time span (defined by two attribute fields). With the OSM data, each feature has a single time field showing when it was added to the database, so I picked Each feature has a single time field.

  • Time Field – This is the attribute field that holds the time information. Depending on what you selected above for Layer Time, you get either one or two dropdowns here. In my case, I specified the 'timestamp' field I showed earlier.

  • Field format – This denotes the pattern or format of the values in the Time Field. The OSM data has a timestamp format of 'yyyy-mm-dd hh:mm:ss', which is valid according to the ISO8601 spec and is also supported by ArcMap. You can see that it's one of the choices in the dropdown.

There are other settings you can adjust in this dialog which will all affect the resulting time-enabled WMS. The ArcGIS Desktop Help explains these options in detail.


After adjusting these settings, you can save the map and prepare for publishing to ArcGIS Server.


Publishing the time-enabled WMS


The workflow for publishing a time-enabled WMS with ArcGIS Server is the same as publishing a regular WMS. You just publish your map as an ArcGIS Server map service, and enable the WMS capability on it. Both .msd and .mxd files can be published as map services exposing time-aware data.


Once you start the map service, you can begin making WMS requests to it.


Consuming the time-enabled WMS


There are many good WMS clients in either the commercial or open source realms, but ArcMap is a particularly appropriate client for a time-enabled WMS because it comes with a time slider. This not only lets you display or animate your map using the TIME parameter, but also helps you parse and display temporal extent information advertised in the GetCapabilities response.


ArcMap time slider


Here are some brief steps to consume a time-enabled WMS in ArcMap:



  1. Start ArcMap and add your WMS layer.

  2. Click the Open Time Slider Window button. Open Time Slider button in ArcMap

  3. Experiment with dragging the time slider or playing the time animation.

In the series of images below, the time slider demonstrates the daily addition of data to OSM in the Port-au-Prince area in the weeks following the earthquake.


Time slider progression as data added to Haiti in OSM

Tidak ada komentar: