GeoGratis Web Services

The GeoGratis platform offers an application-programming interface (API) that provides developers with the ability to search, discover, assess and access data and information products such as maps, images, photos and documents.

GeoGratis API

Notes:

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

Street address search is not accurate (missing Block Face Addressing attribute) for British Columbia and Saskatchewan provinces.

Overview

The API allows developers to embed GeoGratis search, discovery and access functionalities into new or existing applications and services located within their own work environment. By utilizing the latest web-application standards, protocols and formats, the API aims to minimize the burden of development and maximize the re-use of GeoGratis data and information products.

Architecture

Building on the core principles of Web architecture, the GeoGratis API exposes resources that can be easily consumed in both machine- and human-readable forms.

GeoGratis resources are uniquely identified by Uniform Resource Identifier (URI), encoded as hypertext, and are accessed according to the standard HTTP protocol (i.e. HTTP GET).

Protocol and Data Model

The GeoGratis API exposes (presents) bilingual collections of metadata resources via extensions to the ATOM Publishing Protocol (AtomPub), as ATOM feeds, and other formats. ATOM provides a generic, standard content model while AtomPub provides a widely adopted, generic, standard protocol for access to feed-based content.

The GeoGratis metadata collection contains many records. Each record is a description of an existing geospatial information product or service. Because the GeoGratis metadata collection contains so many records, it is served piece-wise, in pages, to conserve server and client resources. Each "page" of the collection contains some fraction of the overall collection that was requested. Client applications can retrieve the "next page", by following links embedded in the response.

Records of the GeoGratis metadata collection are by default represented as Atom entries. These entries contain North American Profile of ISO 19115 metadata descriptions of geospatial information products and services.

Behavior

The GeoGratis API is stateless. That is, it does not store or manage client or application state (also known as sessions). Stateless protocols treat each request as an independent transaction. Clients transfer from one state to another via hypermedia (i.e. links to resources) typically embedded in responses from the server.

In practice, clients interrogate an ATOM entry to discover what links are available. These links, when dereferenced, transfer the client to the requested state. For example, an ATOM entry can contain URI's to a different format or language representation of itself.

More Information

Complete protocol and format documentation can be found in the Getting Started Guide and the Hypermedia Developers Guide.

GeoLocation API

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

Overview

The Geolocation service allows end users to get the geographic location of named features. The current service allows the location of following features:

  • Street addresses
  • Street names
  • Streets intersection
  • Place names such as towns, villages, municipalities, parks
  • Natural geographical features such as lakes, islands, rivers, mountains
  • Postal codes (FSA code only - first three characters)
  • Map numbers from the National Topographic System (NTS)

For a complete description and request examples, please see the section Geolocation Service.

Delimitation Service

Description

The service provides access to geometry extents (delimitation) for various type of tessellation of the Canadian landmass. The service currently offers delimitations from the following coverages:

  • Drainage Areas (detailed or generalized geometries)
  • Landsat Footprints
  • Map Sheets from the National Topographic System (NTS)

For a complete description and request examples, please see the section Delimitation Service.

Elevation API

End User Documentation

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

Canadian Digital Elevation Model (CDEM)

Canadian Digital Surface Model (CDSM)

For a complete description and request examples, please see the section Elevation API.

Canada Base Map (CBM)

"Continuous base mapping coverage from national to local scales in a single, easy-to-use, cartographically designed, web mapping service"

Overview

The Canada Base Map - Transportation (CBMT) web mapping services of the Earth Sciences Sector (ESS) at Natural Resources Canada (NRCan) are intended primarily for online mapping application users and developers. These services are available in multiple formats and projections including: WMS, WMTS, ESRI REST, SOAP, Lambert Conformal Conic (ESPG:3978), Web Mercator (EPSG:3857), etc.

These services can be accessed at no cost and without restrictions according to the terms of the license at Open Government Licence – Canada.

This collection of base map services have been created to provide locational context with an emphasis on transportation networks over which thematic information can be overlaid. Cartography (colour, symbology, etc.) of the base map has been specifically designed so that thematic information will be more prominent than the locational information. The range of viewing scales for this service is between 1:200 000 000 and 1:1 000 for Dynamic and between 1:200 000 000 and 1: 18 000 for Cached. Features from the following datasets are used by the CBMT service: CanVec, GeoBase, the National Topographic Data Base (NTDB) and base data from the Atlas of Canada National Scale datasets.

Canada Base Map – Transportation (CBMT) URLs:

ArcGIS Server

WMS (Web Mapping Service) Server

Canada Base Map – Elevation (CBME) URLs:

ArcGIS Server

Service Requests

The CBMT WMS adequately supports mandatory operations (GetCapabilities and GetMap) as defined in the OGC WMS standard, version 1.1.1. If available, the other operations do not guarantee any results.

Data sources used

The data sources used in the CBMT service vary depending on the scale requested. The table below describes the use of these sources based on the scale requested in the query.

Data Source Data Scale Minimum Scale Maximum Scale
CanVec 1:50 000 1:1 000 1:115 000
NTDB 1:250 000 1:115 001 1:550 000
Atlas of Canada National Scale Data 1:1 000 000 1:550 001 1:2 750 000
Atlas of Canada National Scale Data 1:5 000 000 1:2 750 001 1:13 750 000
Atlas of Canada National Scale Data 1:15 000 000 1:13 750 001 1:200 000 000

WMS - Toporama

The Toporama Web Mapping Service (Toporama WMS) of the Earth Sciences Sector (ESS) at Natural Resources Canada (NRCan) is an Internet service that is intended mainly for online map application users and developers. These services are available in multiple projections.

These services can be accessed at no cost and without restrictions according to the terms of the license at Open Government Licence – Canada.

This service can be used to build a customized map using the best baseline data from the ESS for a given scale. They are grouped together under 16 information themes developed, depending on the scale, using the CanVec product.

Main URLs for the Toporama WMS by official language:

  • Toporama WMS English*: http://wms.ess-ws.nrcan.gc.ca/wms/toporama_en
  • Toporama WMS French*: http://wms.ess-ws.nrcan.gc.ca/wms/toporama_fr

*For use in a WMS Client, for example in GIS software and applications.

Service requests

The Toporama WMS adequately supports the operations required (GetCapabilities and GetMap) as defined in the OGC WMS standard, version 1.1.1. If available, the other operations do not guarantee any results.

GetCapabilities is an operation that produces a descriptive XML document including general information on the Toporama WMS, along with the description of each data layer. Example of this type of request addressed to Toporama WMS.

GetMap is an operation that allows the user to obtain a raster map containing the requested layers selected from all the available layers as defined in the document produced by the GetCapabilities operation. This operation requires several arguments to define elements such as the data layers, region, projection, size, image format, etc. The complete list of arguments required is available in the aforementioned OGC document. Example of a GetMap operation request.

Data sources used

The data sources used vary depending on the scale requested. The table below describes the use of these sources based on the scale requested in the query.

Data Source Data Scale Minimum Scale Maximum Scale
CanVec 1:50 000 1:1 000 1:115 000
NTDB 1:250 000 1:115 001 1:550 000
Atlas of Canada National Scale Data 1:1 000 000 1:550 001 1:2 750 000
Atlas of Canada National Scale Data 1:5 000 000 1:2 750 001 1:13 750 000
Atlas of Canada National Scale Data 1:15 000 000 1:13 750 001 1:200 000 000

Maps for HTML

GeoGratis offers users the ability to easily create their own customizable maps in a web browser. To create a map in your web page using GeoGratis' open geospatial data, you simply write an HTML element, as follows:

<!DOCTYPE html>
<html>
   <head>
     <title>My First web Map</title>
     <script src="http://geogratis.gc.ca/mapml/client/bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
     <link rel="import" href="http://geogratis.gc.ca/mapml/client/bower_components/web-map/web-map.html">
   </head>
   <body>
     <map is="web-map" zoom="3" lat="66.9413186" lon="-83.9229196" width="800" height="640" projection="CBMTILE" controls>
       <layer- src="http://geogratis.gc.ca/mapml/en/cbmtile/cbmt" label="Canada Base map" checked ></layer->
     </map>
   </body>
</html>

The above HTML code will render a customizable, interactive map in most web browsers:

Web Maps - Canada Base Map

Further information about how to mark up an HTML document to create maps with the custom HTML map element can be found in the Maps for HTML - Tutorial.

Map Markup Language

MapML allows browsers to render and users to interact with maps directly, as illustrated above. Typical web services require specialized client software, but MapML is designed for use in the browser, to be consumed by the <map> custom HTML element at plain web URLs. GeoGratis offers several sources of MapML, in various projections.

MapML services

Search for and discover NRCan MapML services in our GeoGratis catalogue.

For Further Information

Further information about MapML can be found in the specification. In order to receive community support with using the custom map element and MapML, please consider participating in the Maps for HTML Community Group and contributing via Github.

NapGen (NAP XML Generator)

Overview

NapGen generates NAP-conformant XML for a database.

NAP (North American Profile of ISO 19115:2003 — Geographic Information — Metadata) is a National Standard of Canada. It is a recommendation on organizing geographic information. NAP includes a schema which defines placeholders for data and their relationships.

With NapGen, you interactively navigate a tree of placeholders to map them to database data. NapGen then generates a NAP-conformant XML file for each database record and applies schema-based validation to the generated XML.

NapGen includes a tool - NAP File Validator. You can use it to validate an XML file according to the NAP schema.

Operating Environment

NapGen is web-based (served up by Apache running on 32-bit Windows 7 or XP).

You can use it with Google Chrome, Microsoft Internet Explorer, and Mozilla Firefox.

The supported DBMSes are Microsoft SQL Server, Oracle, and PostgreSQL.

Installation

To install NapGen, download the distribution zip, un-zip it, then click on the file aaaReadme.html.

Distribution Zip