Language selection

Search


Elevation API

Note: Please note that the service is also available via the https protocol.

End User Documentation

Elevation API provides information about the relief based on two data source:

Canadian Digital Elevation Model (CDEM)
The CDEM stems from the existing Canadian Digital Elevation Data (CDED). The latter were extracted from the hypsographic and hydrographic elements of the National Topographic Data Base (NTDB) at the scale of 1:50 000, the Geospatial Database (GDB), various scaled positional data acquired by the provinces and territories, or remotely sensed imagery. In the CDEM data, elevations can be either ground or reflective surface elevations. The CDEM data covers the Canadian Landmass.
Canadian Digital Surface Model (CDSM)
The 0.75-second (~20 m) CDSM consists of a derived product from the original 1-second (30 m) Shuttle Radar Topographic Mission (SRTM) digital surface model (DSM). The CDSM provides a complete coverage of the Canadian territory south of latitude 60 degrees North. In these data, the elevations are captured at the top of buildings, trees, structures, and other objects rather than at ground level.

The following features are available for each coverage data:

  • Get the Elevation of a Location
  • Create Elevation Profile

Get the Elevation of a Location

This feature provides the altitude of a place from a geographic coordinate (latitude / longitude) in decimal degrees. The following URL is a request for the atitude of the place located at coordinate 45°30'N, 71°30'W for the CDEM coverage.

http://geogratis.gc.ca/services/elevation/cdem/altitude?lat=45.5&lon=-71.5

{
    "altitude": 326.0,
    "vertex": true,
    "geometry": {"type":"Point","coordinates":[-71.5,45.5]}
}

The equivalent URL for the altitude of the same place according to the CDSM coverage is:

http://geogratis.gc.ca/services/elevation/cdsm/altitude?lat=45.5&lon=-71.5

{
    "altitude": 320.919,
    "vertex": true,
    "geometry": {"type":"Point","coordinates":[-71.5,45.5]}
}

Request Parameters

Request Parameters are summarized in the following table. All parameter values need to be URL encoded.

Parameter Meaning
lat Latitude of the location in decimal degrees.
lon Longitude of the location in decimal degrees.

Create Elevation Profile

This feature provides the elevation profile representing the intersection of a line segment with the terrain. The following URL provides the elevation profile of the line segment between the coordinates 45°15'N, 72°30'W and 45°45'N, 71°30'W.

http://geogratis.gc.ca/services/elevation/cdem/profile?path=LINESTRING(-72.5 45.25, -71.5 45.75)

[
    {
        "altitude": 197.0,
        "vertex": true,
        "geometry": {"type":"Point","coordinates":[-72.5,45.25]}
    },
    {
        "altitude": 363.0,
        "vertex": true,
        "geometry": {"type":"Point","coordinates":[-71.5,45.75]}
    }
]

The following URL provides the elevation profile between the same two coordinates but by interpolating the elevation of ten additional points distributed along the line segment.

http://geogratis.gc.ca/services/elevation/cdem/profile?path=LINESTRING(-72.5 45.25, -71.5 45.75)&steps=10

Request Parameters

Request Parameters are summarized in the following table. All parameter values need to be URL encoded.

Parameter Meaning
path Geometry of the line segment used to determine the elevation profile encoded in Well Known Text (WKT) format - ISO/IEC 13249-3:2011
steps Number of additional points to be added to the original geometry in order to densify the number of calculated elevation

Supported Formats (aka Representations)

Results are presented as an JSON format (application/json) by default. The following additional formats are available depending on the intended usage:

  • application/json(.json) with geometries encoded in GeoJSON. JSONP is also supported by providing a callback parameter.
  • application/xml(.xml) with geometries encoded in GML (Geography Markup Language).

Codes and error messages

In the event that no elevation value is available in the data source, the service will return a null value as the elevation/p>

In the event that the data source or the type of request are unknown, the service returns an error code HTTP Status 404 - Not Found

In the event that a required parameter is omitted or includes an invalid value, the service returns an error codeHTTP Status 400 - Bad Request

Page details

Date modified: