GSoC: Support sub-national maps in grapher #1292
Replies: 1 comment 4 replies
-
Hello OWID community, My name is Minseo Park and I am a Computer Science undergraduate student at Johns Hopkins University. If I’m given the chance, I would love to contribute to OWID’s mission to succinctly convey existing data regarding the world’s problems we face today. Regarding the idea to enable sub-national maps in grapher, would we treat these maps as a subset of the current map charts (i.e. could it be a Child chart of a World Root Table)? Furthermore, just to get an idea of the codebase, would we have a If a prospective mentor could please review my proposal in draft, it would be much appreciated. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
DIFFICULTY: MEDIUM, SIZE: 175 HOURS
Project
We currently only support plotting world maps, for example: a map of life expectancy around the world. We have encountered cases where we have sub-national data (e.g. US states) and would like to use a different map that further sub-divides countries.
Your challenge would be to add a framework to grapher for handling sub-national data, and the mapping support to be able to visualise that data well. Ideally, this framework would work for a huge number of countries with subnational divisions.
Required skills
Technical background
The current status quo (as of March 2022) is that there is a hardcoded set of countries in our codebase which we reference sometimes by (harmonized) name, sometimes by entity id (the id in our Entities Mysql database table for that country) and sometimes by code (the entity code in the Entities Mysql table). Also hardcoded in our codebase is a specific set of SVG paths that have been ingested from geoJson into a hardcoded representation in our source. All of these have the upside that all necessary information is immediately available to Grapher when it starts running and there is nothing else to fetch to show a map; but we are currently moving away from this setup. (See #1233 for a related issue which links further into the history of this project).
As part of another project to rely less on our MySQL database and provide datasets in more re-usable form, we are currently also reworking the understanding Grapher has of countries and geographic regions. One central piece of this new setup is a countries_regions.csv dataset and an effort to always use entity codes as the primary identifiers. This countries_regions.csv file is designed to allow different groupings. Currently we only have continents and the catch all entity World, but soon we want to have e.g. the World Bank Income Regions defined there as well.
The content of this file would be available to grapher always and as such would be a good point to also store subnational entities (e.g. the States of the US). The same hierarchy mechanism that is used there to group countries into continent entities could be used to group such subnational entities into the corresponding national entity.
GeoJson files will probably live in a separate place for the world map with a mapping of our entity codes to the outline of the matching country. Additional GeoJson files could then be added to show subnational entities when data for such is available.
This project would then be a demonstration of coming up with subnational codes, providing their shape, adding the mapping and adding the logic to fetch and show the relevant outlines if subnational entities are present in a dataset that is shown as a map.
Useful resources
Expected outcomes
Potential mentors
Beta Was this translation helpful? Give feedback.
All reactions