WFS Time Series Data

FMI's Open Data WFS service uses stored queries that provide surface weather observations and point forecasts.

Data is available in two formats: multipointcoverage and timevaluepair.

Multipointcoverage is more compact format. But, timevaluepair is fully INSPIRE compatible. Surface weather observations can be queried spatially (bbox) or by using the nearest station location name. Point forecasts can be queried by using the nearest station location name.

Stored query parameters

Parameter list for a stored query is part of the stored query description that can be requested with

Narrow down the query by using stored query identifier parameter:

  • &storedquery_id=fmi::observations::weather::multipointcoverage

For example, get description of the stored query mentioned above by using storedquery_id in the request:

After you have gotten your API-key and have decided which storedquery_id to use, you can request the actual observation or forecast data from the service. For example, you may request forecast data for Helsinki with default values for other parameters:

Examples & Guidelines page gives more examples on how to use stored queries. If you are interested in using JavaScript for stored queries, see description of MetOLib below.

Registration

Registration for API-key is required to use open data service interfaces.

Services contain API-key specific request limitations:

  • Download Service has limit of 20000 requests per day for a single API-key
  • View Service has limit of 10000 requests per day for a single API-key
  • Download and View Services have combined limit of 600 requests per 5 minutes for single API-key

JavaScript

MetOLib is a JavaScript library that provides implementation of API classes that may be used to request weather data from the Web Feature Service (WFS) server of the Finnish Meteorological Institute INSPIRE Atmospheric Features and Geographical Meteorological Features guidelines compatible WFS Download Service server at http://data.fmi.fi.

MetOLib provides a good JavaScript reference implementation for WFS requests. MetOLib can be used to request data from server and to get parsed XML data as JavaScript objects. Also, MetOLib provides cache for requested data.

Get MetOLib from GitHub. MetOLib readme file gives information on how to get started.

An example implementation can be found on http://ilmatieteenlaitos.fi/sadealueet-suomessa

Notice, API-key is required for queries. Register for API-key.

MetOLib example

See API documentation and comments from source code to get more information about functions and parameter objects.

var SERVER_URL = "http://data.fmi.fi/fmi-apikey/insert-your-apikey-here/wfs";
var STORED_QUERY_OBSERVATION = "fmi::observations::weather::multipointcoverage";
var connection = new fi.fmi.metoclient.metolib.WfsConnection();
if (connection.connect(SERVER_URL, STORED_QUERY_OBSERVATION)) {
    // Connection was properly initialized. So, get the data.
    connection.getData({
        requestParameter : "td",
        begin : new Date(1368172800000),
        end : new Date(1368352800000),
        timestep : 60 * 60 * 1000,
        sites : "Helsinki",
        callback : function(data, errors) {
            // Handle the data and errors object in a way you choose.
            handleCallback(data, errors);
            // Disconnect because the flow has finished.
            connection.disconnect();
        }
    });
}


 

15.10.2014