Aligning Ontario’s Scheme for Identifying Census Divisions with Canada’s

Ontario’s Ministry of Finance regularly updates its population projections for the province; its most recent updates were published in the Spring 2016. These population projections are organized into 4 different datasets:

  • projections for the whole province
  • projections for each census division
  • projections for each Local Health Integration Network (LHIN)
  • projections for each Ministry of Children and Youth Services’ Service Delivery Division (SDD) region

Unfortunately (even inexplicably), Ontario uses a different scheme for identifying Census Divisions from Canada’s. We may use this map:

Ontario 2011 Census Divisions - Statistics Canada

and this map:

MofF - Chart 00

allow us to generate the following table of alignments:

Table 4. Aligning Ontario’s scheme for identifying Census Divisions with Canada’s.
CD_ID
(Ontario)
CD_ID
(Canada)
CD_ID
(Ontario)
CD_ID
(Canada)
1 20 26 13
2 18 27 47
3 24 28 1
4 21 29 41
5 19 30 34
6 29 31 37
7 22 32 42
8 28 33 40
9 46 34 36
10 25 35 38
11 44 36 39
12 26 37 32
13 14 38 31
14 15 39 57
15 43 40 56
16 16 41 51
17 30 42 48
18 23 43 49
19 6 44 53
20 10 45 52
21 12 46 54
22 9 47 60
23 7 48 59
24 11 49 58
25 2

We will need to make use of this Table of alignments when we come to map the Ministry of Finance’s population projections onto the boundaries of Ontario’s Local Health Integration Networks (LHINs).

Disclaimer: This post is my personal work and is not sponsored or endorsed by Youthdale Treatment Centres in any way. This work  is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Population Projections in Ontario: The Case for Returning to Life Cycle Groupings

Background

Every year the Ministry of Finance updates its population projections for Ontario and each of its 49 census divisions to reflect the most recent trends and historical data. The Spring 2016 update is based on new 2015 population estimates from Statistics Canada and reflects minor changes in trends in fertility, mortality and migration.

Map of Ontario Census Divisions
Figure 1. Map of Ontario Census Divisions. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.

The Ministry of Finance includes several Charts and Tables that reference various demographic groupings in its analysis of these population projections:

Demographic Groupings
Single Years (0, 1, …, 90+) Statistical Table 6
Five-Year Groupings (0-4, 5-9, …, 85-89, 90+) Statistical Tables 7-10
Life Cycle Groupings (0-14, 15-64, 65+) Charts 5-6, 10-12
Statistical Table 2

To assist in planning, delivering, and evaluating human services – particularly those for young people – we want to differentiate Youth (15-24 years old) from Adult (25-64) instead of using the Ministry of Finance’s original definition of “Adult”: 1

  • Children (0- 14 years old)
  • Youth (15 – 24)
  • Adults (25 – 64)
  • Seniors (65+)

For the interested reader, we have compiled a set of Statistical Tables that restate the population projections for Ontario in terms of our Life Cycle Groupings.

Now, let’s review the highlights of the Ministry of Finance’s analysis.

Provincial overview

The Ministry of Finance considers three scenarios of population growth in Ontario. The medium-growth or reference scenario – the most likely to occur if recent trends continue – projects population growth of 30.1 per cent, from 13.8 million in 2015 to more than 17.9 million in 2041 (Chart 1).

Ontario population, 1971 to 2014
Chart 1. Ontario population, 1971 to 2014. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.

The rate of population growth in Ontario in the reference scenario is projected to decline gradually from 1.2 per cent to 0.8 per cent annually (Chart 2).

Annual rate of population growth in Ontario, 1971 to 2041
Chart 2. Annual rate of population growth in Ontario, 1971 to 2041. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.

Components of population growth

In any given year, the share of population growth due to natural increase versus net migration varies. While natural increase trends evolve slowly, net migration can be more volatile, mostly due to swings in inter-provincial migration and variations in international immigration.

Natural increase

The number of births and deaths in Ontario has been rising slowly and at a similar pace over the last decade. As a result, natural increase has been fairly stable at about 50,000 annually. The rate of population growth due to natural increase over the projection period is affected by two main factors:

  • The passage of the baby boom echo generation (children of baby boomers) through peak fertility years will result in an increased number of births through the late 2010s and early 2020s.
  • The transition of large cohorts of baby boomers into the Seniors group.

Overall, natural increase is projected to be fairly stable around 55,000 over the first decade of the projections, followed by a steady decline to less than 17,000 by 2041. The share of population growth accounted for by natural increase (versus net migration) is projected to decline from 32 per cent in 2016 to 11 per cent by 2041 (Chart 3).

Net migration

Net migration to Ontario has averaged about 77,000 per year in the past decade. Net migration is projected to be higher at the beginning of the projection period than it has been during the past few years, as net losses of population through inter-provincial migration have recently turned to gains and federal immigration targets have been raised significantly.

Ontario’s annual net migration gain is projected to increase from 114,000 in 2016 to 130,000 by 2041. The share of population growth accounted for by net migration (versus natural increase) is projected to rise from 68 per cent in 2016 to 89 per cent by 2041 (Chart 3).

Contribution of natural increase and net migration to population growth in Ontario, 1971 to 2041.
Chart 3. Contribution of natural increase and net migration to population growth, 1971 to 2041. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.

Age structure

The Ministry of Finance displays the distribution of age among the people of Ontario in the familiar form of an age pyramid (Chart 4) and shows how age structure impacts the share of population (Chart 5) and the rate of population growth (Chart 6) accounted for by three Life Cycle Groupings (0-14, 15-64, 65+ years old).

Using our four Life Cycle Groupings ((0-14, 15-24, 25-64, 65+ years old), we have redrawn the projected share of population (Chart 5-PGA) and the projected rate of population growth (Chart 6-PGA):

Age pyramid in Ontario, 2015 and 2041.
Chart 4. Age pyramid in Ontario, 2015 and 2041. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.
Proportion of population aged 0-14, 15-64, and 65+ in Ontario, 1971 to 2041
Chart 5. Proportion of population aged 0-14, 15-64, and 65+ in Ontario, 1971 to 2041. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.
Proportion of population aged 0-14, 15-24, 25-64, and 65+ in Ontario, 2016 to 2041
Chart PGA 5. Proportion of population aged 0-14, 15-24, 25-64, and 65+ in Ontario, 2016 to 2041. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.
Annual rate of growth of population age groups 0-14, 15-64, and 65+ in Ontario, 1971 to 2041
Chart 6. Annual rate of growth of population age groups 0-14, 15-64, and 65+ in Ontario, 1971 to 2041. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.
Annual rate of growth of population age groups 0-14, 15-24, 25-64, and 65+ in Ontario, 2017 to 2041
Chart PGA 6. Annual rate of growth of population age groups 0-14, 15-24, 25-64, and 65+ in Ontario, 2017 to 2041. Source: Ministry of Finance, Ontario Population Projections Update, Spring 2016.

The Ministry of Finance includes the following analysis (pp. 8-10):

By 2041, there will be more people in every age group in Ontario compared to 2015, with a sharp increase in the number of seniors. Baby boomers will have swelled the ranks of seniors; children of the baby boom echo generation will be of school-age; and the baby boom echo cohorts, along with a new generation of immigrants, will have bolstered the population aged 15–64. ...

The number of children aged 0–14 is projected to increase gradually over the projection period, from 2.2 million in 2015 to almost 2.7 million by 2041. The share of children in the population is projected to decrease from 15.9 per cent in 2015 to 14.9 per cent by 2041. By the late 2030s, the number of children is projected to grow at a much slower pace than other age groups, reflecting the smaller number of women in their 20s and 30s. ...

Within the 15–64 age group, the number of youth aged 15–24 is initially projected to decline slightly, from a high of 1,827,000 in 2015 to a low of 1,725,000 by 2022. The youth population is then projected to resume growing, reaching almost 2.1 million by 2041. The youth share of total population is projected to decline from 13.2 per cent in 2015 to 11.1 per cent by 2033, followed by a small rise to 11.5 per cent by 2041. ...

In this last paragraph, the Ministry of Finance makes its one and only substantial reference to “youth” – yet it’s a pretty important point: While the number of Youth in Ontario is projected to decline over the next five years, their numbers will increase steadily thereafter – in fact, becoming the fastest growing demographic by the end of the projection period. The Ministry’s graphics (Charts 5-6), unfortunately, obscure what’s going on here – as is immediately apparent when we differentiate Youth (15-24 years old) from Adult (25-64) using the Life Cycle Groupings  (Charts PGA 5-6).

Next time: We “drill down” to the level of the region and census division – where the planning, delivery and evaluation of human services take place or where, at least, I’d argue that they should. Meanwhile, the interested reader may want to consult our Statistical Tables that restate the population projections for Ontario in terms of the Life Cycle Groupings.

  1. In fact, Statistics Canada used these four Life Cycle Groupings until 2007. In this sense, we’re arguing for the return to Life Cycle Groupings when it comes to understanding population projections – especially when one is concerned with young people. The Ministry of Finance refers to “youth” only twice – once in passing while noting that some census divisions of Northern Ontario experiencing net out-migration, mostly among youth (p. 12) and once in the context of a more substantial discussion of changes in the annual rate of population growth due to age structure (p. 10, and see below).

Overlaying the boundaries of the Local Health Integration Networks and Children and Youth Mental Health Service Areas in Ontario

Preamble

This article was originally posted on May 14, 2016 and revised on July 28, 2016 to take account of changes in the geospatial representation of Children and Youth Mental Health Service Areas in Ontario. For more details, see … and then there were 33.

In a series of previous posts, we have visualized the boundaries of the MCYS Integrated Service Regions (ISRs) and the MCYS Children and Youth Mental Health (CYMH) Service Areas.

Now we want to merge the digital boundaries of the CYMH Service Areas with the MOHLTC’s Local Health Integration Networks (LHINs) in Ontario.

The boundaries of the LHINs in 2015 are provided in the ESRI ® shapefile format (HRL035b11a_e.zip) by Statistics Canada. The .zip file contains four familiar files:

  • HRL03b11a_e.dbf
  • HRL03b11a_e.prj
  • HRL03b11a_e.shp
  • HRL03b11a_e.shx

The projection information in the HRL03b11a_e.prj file indicates that the geospatial data for the LHINs uses the EPSG 3347 PCS Lambert Conformal Conic projection. 1 So we convert the original shapefile for the LHINs to the same projection (EPSG 4269) used for the CYMH Service Areas:

ogr2ogr -f 'ESRI Shapefile' -t_srs EPSG:4269 lhins.shp HRL035a11a_e_Sept2015.shp

Next we convert the new shapefile lhins.shp to a GeoJSON file and then to a TopoJSON file (see Visualizing the MCYS Integrated Service Regions Using d3.geo for the details of this process):

ogr2ogr -t_srs EPSG:4269 -f GeoJSON lhins_geo.json lhins.shp
topojson -o lhins_topo.json --properties -- lhins_geo.json

Finally, to merge the TopoJSON file for the CYMH Service Areas and the TopoJSON file for the LHINs into a single TopoJSON file, we need to install the utility geojson-merge:

npm install -g geojson-merge

and then run:

geojson-merge cymhsas_geo.json lhins_geo.json > cymhsas_lhins_geo.json

The properties of cymhsas_lhins_topo.json include:

HR_UID -> idHealth Region ID

Property Value
area_index Identifier of CYMH Service Area
area_name Name of CYMH Service Area
ENG_LABEL -> lhin_name Name of LHIN (English)
FRE_LABEL Name of LHIN (French)

We use Notepad++ to rename ENG_LABEL to lhin_name. We then promote HR_UID to the id property of the TopoJSON file.

topojson -o cymhsas_lhins_topo.json --id-property HR_UID --properties -- cymhsas_lhins_geo.json

And finally, we use Notepad++ to add the isr and color properties to the CYMH Service Areas.

Notes:

Our visualization of the MCYS and MOHLTC geospatial data includes the following features:

  • the five Integrated Service Regions and their respective CYMH Service Areas are distinguished with different hues
  • the boundary and name of a Local Health Integrated Network are displayed when the user hovers the mouse over one of the thirteen LHINs
  • the user may pan and zoom in on the visualization

Our visualization requires only these few modifications of the Javascript we developed to display the names of the CYMH Service Areas:

/* CSS */
...
.lhin_area:hover{
  stroke: #000;
  stroke-width: 1.5 px;
}

/* Javascript */
...

function draw(topo) {

var service_area = g.selectAll(".area_name").data(topo);

/* Visualize the CYMH Service Areas in colour, use id index to assign transparent colour to LHINs */
service_area.enter().insert("path")
.attr("class", "lhin_area")
.attr("d", path)
.attr("id", function(d,i) { return d.id; })
.style("fill", function(d,i) { return i <= 32 ? d.properties.color : 'transparent' });

/* define offsets for displaying the tooltips */
var offsetL = document.getElementById('map').offsetLeft+20;
var offsetT = document.getElementById('map').offsetTop+10;

/* toggle display of tooltips in response to user mouse behaviours*/
service_area

.on("mousemove", function(d,i) {
var mouse = d3.mouse(svg.node()).map( function(d) { return parseInt(d); } );
tooltip.classed("hidden", false)
.attr("style", "left:"+(mouse[0]+offsetL)+"px;top:"+(mouse[1]+offsetT)+"px")
.html(d.properties.lhin_name);
})

.on("mouseout", function(d,i) {
tooltip.classed("hidden", true);
});

}

… yielding the following visualization (interactive version):

Overlay LHINs on CYMH Service Areas
Figure 1. Screenshot of LHIN superimposed on CYMH Service Areas.

Next time: We’ll begin to merge the geospatial data in our TopoJSON files with demographic data in the public domain.

 

  1. Using Prj2EPSG.

Adding pan and zoom to a visualization of the CYMH Service Areas in Ontario

Preamble

This article was originally posted on May 14, 2016 and revised on July 28, 2016 to take account of changes in the geospatial representation of Children and Youth Mental Health Service Areas in Ontario. For more details, see … and then there were 33.

In previous posts, we have described:

  1. method for partitioning the Ontario government’s Shapefile archive of the thirty-four thirty-three MCYS Children and Youth Mental Health (CYMH) Service Areas into five groupings, corresponding to the MCYS Integrated Service Regions (ISRs)
  2. a method for using the TopoJSON files to visualize the CYMH Service Areas within the separate ISRs
  3. the addition of tooltips to display the names of the CYMH Service Areas across Ontario
  4. the addition of a responsive framework to ensure that our visualizations accommodate to the display capabilities of various PCs, laptops, tablets, and smart phones

Here we highlight the additional code that’s required to allow the user to pan and zoom the visualization of the CYMH Service Areas with tooltips (#3  above):

<!DOCTYPE html>
<meta charset="utf-8">
<style>

/* CSS goes here */

/* define the container element for our map */
#map {
 margin:5% 5%;
 border:2px solid #000;
 border-radius: 5px;
 height:100%;
 overflow:hidden;
 background: #FFF;
}

/* style of the text box containing the tooltip */

div.tooltip {
 color: #222; 
 background: #fff; 
 padding: .5em; 
 text-shadow: #f5f5f5 0 1px 0;
 border-radius: 2px; 
 box-shadow: 0px 0px 2px 0px #a6a6a6; 
 opacity: 0.9; 
 position: absolute;
}

/* style of the text displayed in text box of the tooltip when mouse is hovering over a CYMH Service Area */

.service_area:hover{ stroke: #fff; stroke-width: 1.5px; }

.text{ font-size:10px; }

/* otherwise, the text box of the tooltip is hidden */
.hidden { 
 display: none; 
}

</style>
<body>

/* create the container element #map */
<div id="map"></div>

/* load Javascript libraries for D3 and TopoJSON */
<script src="//d3js.org/d3.v3.min.js"></script>
<script src= "//d3js.org/topojson.v1.min.js"></script>

<script> // begin Javascript for visualizing the geo data

/* define some global variables */

var topo, projection, path, svg, g;

/* 1. Set the width and height (in pixels) based on the offsetWidth property of the container element #map */

var width = document.getElementById('map').offsetWidth;
var height = width / 2;

/* Call function setup() to create empty root SVG element with width, height of #map */

setup(width,height);

function setup(width,height){

/* 2. Create an empty root SVG element */
d3.behavior.zoom(), constructs a zoom behavior that creates an even listener to handle zoom gestures (mouse and touch) on the SVG elements you apply the zoom behavior onto

svg = d3.select('#map').append('svg')
 .style('height', height + 'px')
 .style('width', width + 'px')
.append('g') 
.call(zoom);

g = svg.append('g')
    .on("click", click);

} // end setup()

/* 3. Define Unit Projection using Albers equal-area conic projection */

var projection = d3.geo.albers()
 .scale(1)
 .translate([0,0]);

/* 4. Define the path generator - to format the projected 2D geometry for SVG */

var path = d3.geo.path()
 .projection(projection);

/* 5.0 Start function d3.json() */
/* 5.1 Load the TopoJSON data file */

d3.json("http://cartoserve.com/maps/ontario/cymhsas33_data/cymhsas_topo.json", function(error, cymhsas_topo) {
if (error) return console.error(error);

/* 5.2 Convert the TopoJSON data back to GeoJSON format */
/* and render the map using Unit Projection */

var areas_var = topojson.feature(cymhsas_topo, cymhsas_topo.objects.cymhsas_geo);

/* 5.2.1 Calculate new values for scale and translate using bounding box of the service areas */
 
var b = path.bounds(areas_var);
var s = .95 / Math.max((b[1][0] - b[0][0]) / width, (b[1][1] - b[0][1]) / height);
var t = [(width - s * (b[1][0] + b[0][0])) / 2, (height - s * (b[1][1] + b[0][1])) / 2];

/* 5.2.2 New projection, using new values for scale and translate */
projection
 .scale(s)
 .translate(t);

/* redefine areas_var in terms of the .features array, assign array to topo */
var areas_var = topojson.feature(cymhsas_topo, cymhsas_topo.objects.cymhsas_geo).features;

topo = areas_var;

/* make the map by calling our draw() function initially within the d3.json callback function */
 
draw(topo);

}); // end function d3.json

function draw(topo) {

var service_area = g.selectAll(".area_name").data(topo);

service_area.enter().insert("path")
.attr("class", "service_area")
.attr("d", path)
.attr("id", function(d,i) { return d.id; })
.style("fill", function(d, i) { return d.properties.color; })
.attr("title", function(d,i) { return d.properties.area_name; });

/* define offsets for displaying the tooltips */
var offsetL = document.getElementById('map').offsetLeft+20;
var offsetT = document.getElementById('map').offsetTop+10;

/* toggle display of tooltips in response to user mouse behaviours*/
service_area
// begin mousemove
.on("mousemove", function(d,i) {
var mouse = d3.mouse(svg.node()).map( function(d) { return parseInt(d); } );
tooltip.classed("hidden", false)
.attr("style", "left:"+(mouse[0]+offsetL)+"px;top:"+(mouse[1]+offsetT)+"px")
.html(d.properties.area_name);
}) // end mousemove
// begin mouseout
.on("mouseout", function(d,i) {
tooltip.classed("hidden", true);
}); // end mouseout

} // end draw()

function move() {

 var t = d3.event.translate;
 var s = d3.event.scale; 
 zscale = s;
 var h = height/4;

 t[0] = Math.min(
 (width/height) * (s - 1), 
 Math.max( width * (1 - s), t[0] )
 );

 t[1] = Math.min(
 h * (s - 1) + h * s, 
 Math.max(height * (1 - s) - h * s, t[1])
 );

 zoom.translate(t);
 g.attr("transform", "translate(" + t + ")scale(" + s + ")");

 //adjust the Service Area hover stroke width based on zoom level
 d3.selectAll(".service_area").style("stroke-width", 1.5 / s);

}

/* our function click() uses the .invert() configuration method */
/* to project backward from Cartesian coordinates (in pixels) to spherical coordinates (in degrees) */

function click() {
 var latlon = projection.invert(d3.mouse(this));
 console.log(latlon);
}

</script> // end Javascript for visualizing the geo data

Giving us the following interactive visualization of the CYMH Service Areas in Ontario.

Next time: We will show how to merge our visualization of the geography of the CYMH Service Areas with other data about the populations and service providers within these Service Areas.

A responsive framework for visualizing CYMH Service Areas in Ontario

In previous posts (1, 2, 3) we described a method for visualizing geographic representations of Integrated Service Regions (ISRs) and Children and Youth Mental Health Service Areas (CYMHSAs) in Ontario using free and open source software.

This brief note is to advise we are now running D3 in tandem with Bootstrap – a responsive framework that ensures that our visualizations accommodate to the display capabilities of a wide range of digital devices, including PCs, laptops, tablets, and smartphones. 1

 

  1. See our guidelines for installing Bootstrap on a Linux server.

211 Ontario

Adapted from About 211 Ontario

Mission

211’s telephone helpline and regional websites provide a gateway to community, social, non-clinical health and related government services. 211 helps to navigate the complex network of human services quickly and easily, 24 hours a day, 7 days a week.

By creating easy access to comprehensive, up-to-date information and data about human services, decision-makers – whether households, communities or governments – can make better informed decisions about the choices facing them, before problems spiral into a crisis.

Ontario 211 connects people to the right information and services, strengthens Ontario’s health and human services, and helps Ontarians to become more engaged with their communities.

211 in Ontario – Vision and Roadmap 2013 to 2015

Governance & Partnerships

211 in Ontario is governed by Ontario 211 Services, a non-profit agency with five full-time staff and a dedicated Board of Directors. They work in collaboration with seven Regional 211 Service Providers, and a unique network of data contributors to deliver 211 services though the phone and through online channels to all Ontario residents.

Funding

All three levels of government and United Ways fund Ontario 211. The Province of Ontario supports 211 through annual funding from the Ministry of Community and Social Services. The Ontario Trillium Foundation has been a generous contributor to our development. The federal government has provided support through Citizenship and Immigration Canada.

Ontario 211 is committed to open data

211’s goal is to be seen as the authoritative source for credible information about human services. Achieving that rests on 211’s continued high data quality, adoption of leading edge communications technology to improve access to that information, and open data practices that encourage collaboration to develop innovative uses contributing to the public good.

211’s information is the ultimate public resource. Ontario 211 is a public purpose body, which uses public funds to collect, organize and disseminate public information about human service organizations.

By providing open access to data, Ontario 211 collaborates with the broader public and professional communities who can examine how the human services system operates throughout Ontario. Meaningful analysis will identify successes in the social infrastructure as well as identify areas needing improvement.