MSC GeoMet Web Feature Service (WFS) 3.0 API HowTo
OGC Web Feature Service 3.0
MSC GeoMet WFS 3.0 API Overview
The OGC WFS 3.0 API provides a specification to querying geospatial data on the web.
The service operates over HTTP.
Requests are made via HTTP GET requests.
Responses are JSON/GeoJSON by default.
No HTTP authentication is required.
OpenAPI 3.0 Document
List all feature collections available:
The response provides a list of feature collections with associated metadata (title, description, links, extent, CRS).
List a single feature collection:
Inspecting Feature Collection Schema
Issue a query returning a single feature to inspect geometry and properties:
Querying feature collections allows for spatial, temporal and property filtering. Filter parameters can be combined to formulate an exclusive ('and') search.
The examples that follow use the hydrometric daily mean feature collection.
Default query, no filters:
Query by bounding box (minx, miny, maxx, maxy)
Query by a single time instant:
Query by a time extent:
Query by a feature collection property:
startindex parameter can be used to specify the record to start at when extracting
features. The default value is 0 (first feature).
limit parameter is used to define the maximum records to return as part of querying
for features. The default response size is 500 features. Setting a
limit of 0 results
in returning only the number of features found (without the actual features returned).
Paging through results
limit parameters can be used in tandem to cycle through feature collections. The examples below demonstrate how to adjust and page through query results.
Query and limit to features 1-2:
Query and limit to features 1-100:
Query and limit to features 101-200:
Strategies for paging
The paging strategy is commonly used in support of performance when returning large data extractions. For example, a client could page by 1000 features to cycle through an entire station record:
The client can then simply cycle through all items until there no longer any records. This would constitute the entire record.
Another strategy that can be used is to query for all data without returning any records:
...and then inspecting the response (see
numberMatched) to assess the size of the entire record. The client can then decide how or whether to page accordingly.
Combining Filter Parameters
Query all daily mean data from a single station between 2001 and 2010:
Exporting to CSV format
Any query can be exported to CSV by adding
f=csv to the request.
Any query can be sorted by adding
PROPERTY is the sort property and
X is the sort order (
A is ascending,
D is descending). Sort order is optional. Sorting by multiple properties is supported by providing a comma-separated list to the
Access by Identifier
Fetch a single feature by identifier:
Tools and Implementations
Using GDAL's WFS 3 support:
# list datasets ogrinfo WFS3:https://geo.weather.gc.ca/geomet/features # describe a single dataset ogrinfo WFS3:https://geo.weather.gc.ca/geomet/features hydrometric-daily-mean -al -so # perform spatial query ogrinfo WFS3:https://geo.weather.gc.ca/geomet/features hydrometric-daily-mean -spat -100 50 -90 55
Using geojson.io, copy/paste any query result to visualize and point/click query.