Geospatial features of the MCYS Children and Youth Mental Health Service Areas

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 2014-15, the Ministry of Children and Youth Services (MCYS) defined two administrative views of mental health services for children and youth in Ontario:

The provincial government has published geospatial data for the MCYS’s Integrated Service Regions (ISRs) and Children and Youth Mental Health Service Areas (CYMHSAs) in Shapefile format.

Here, we’ll work only with the geospatial data for the CYMHSAs, publishing three sorts of files for use in d3.geo:

  1. Converting the Shapefile archive (cymh_shapefile.zip cymh_service_areas_after_march_9_2015.zip) for the entire set of thirty-four MCYS Children and Youth Mental Health Service Areas into a single TopoJSON file (cymhsas_topo.json)
  2. Partitioning the Shapefile archive in #1 into five groups of Service Areas, corresponding to the Integrated Service Regions, and converting these five groups into TopoJSON files:
    1. central_topo.json
    2. east_topo.json
    3. north_topo.json
    4. toronto_topo.json
    5. west_topo.json
  3. Partitioning the Shapefile archive in #1 into thirty-four thirty-three groups, corresponding to the individual MCYS Children and Youth Mental Health Service Areas, and converting these groups into TopoJSON files

Shapefile archive for 34 33 CYMHSAs

The Shapefile archive  for the thirty-four thirty-three MCYS CYMHSAs (cymh_service_areas_after_march_9_2015.zip) contains four files:

  • CYMH Service Areas.shp — shape format
  • CYMH Service Areas.shx — shape index format
  • CYMH Service Areas.dbf — attribute format
  • CYMH Service Areas.prj — projection format: the coordinate system and projection information, expressed in well-known text format

we rename the four CYMH Service Areas.* files cymh-service-areas.*

Converting the Shapefile archive to GeoJSON and TopoJSON format

To use d3.geo to visualize the CYMHSAs, we first use ogr2ogr to convert the Shapefiles to GeoJSON format, and then use topojson to convert the GeoJSON file to TopoJSON format:

ogr2ogr -t_srs EPSG:4269 -f GeoJSON cymhsas_geo.json cymh-service-areas.shp

topojson -o cymhsas_topo.json --id-property area_name --properties -- cymhsas_geo.json

Notes:

  • After running ogr2ogr, we use a text editor to replace the feature property Name with area_name in the file cymhsas_geo.json 1
  • The --id-property switch in topojson is used to promote the feature property area_name to geometry id in the file cymhsas_topo.json
  • We use a text editor to remove any special characters (e.g. spaces, “,”, “/”, “-“) from the value of the geometry id, e.g. “"id": "Haliburton/Kawartha Lakes/Peterborough"" becomes “"id": "HaliburtonKawarthaLakesPeterborough"” in cymhsas_topo.json

Partitioning the Shapefile archive of CYMHSAs into ISRs

We illustrate the partitioning of the Shapefile archive into groups of Children and Youth Mental Health Service Areas corresponding to the five Integrated Service Regions with the script for the North Region.
For 34 CYMHM Service Areas:

ogr2ogr -t_srs EPSG:4269 -f GeoJSON -where "Name =  'Algoma' OR Name = 'Greater Sudbury/Manitoulin/Sudbury' OR Name = 'James Bay Coast' OR Name = 'Kenora/Rainy River'  OR Name = 'Nipissing/Parry Sound/Muskoka' OR Name = 'Thunder Bay' OR Name =  'Timiskaming/Cochrane'" north_geo.json cymh-Service-Areas

topojson -o north_topo.json --id-property area_name --properties -- north_geo.json

For 33 CYMH Service Areas:

ogr2ogr -t_srs EPSG:4269 -f GeoJSON -where "ServiceA00 =  'Algoma' OR Name = 'Greater Sudbury/Manitoulin/Sudbury' OR Name = 'Kenora/Rainy River'  OR Name = 'Nipissing/Parry Sound/Muskoka' OR Name = 'Thunder Bay' OR Name =  'Cochrane/Timiskaming'" north_geo.json cymh-service-areas.shp

topojson -o north_topo.json --id-property area_name --properties -- north_geo.json

Note:

  • The MCYS uses various spelling conventions for compound CYMHSAs; the authoritative list of CYMHSAs naming conventions is found in CYMH-Service-Areas.dbf in the Shapefile archive.

Partitioning the Shapefile archive of CYMHSAs into individual CYMHSAs

Partitioning of the Shapefile archive into individual Children and Youth Mental Health Service Areas is straightforward, e.g.:

ogr2ogr -t_srs EPSG:4269 -f GeoJSON -where "Name = 'Toronto'" toronto_geo.json cymh-service-areas.shp

topojson -o toronto_topo.json --id-property area_name --properties -- toronto_geo.json

I’ve made a complete set of these GeoJSON and TopoJSON available for anyone to use freely.