🛠️
Wazimap technical handbook
  • Introduction
  • System Architecture
    • Database Models
    • IndicatorData
    • Geography Hierarchies
    • Choropleth Maps
    • Determine which instance to use
  • Development
    • Code Deployment
    • Component Architecture
    • Development Process
    • Pull Request Template Explanation
    • Code Review Process
    • Pull Request Template (FE)
    • Webflow Integration
    • Merging webflow exports
    • Rules for Webflow exports
    • Webflow exports & changelog
      • June 2023
      • March 2023
      • February 2023
      • December 2022
      • November 2022
      • October 2022
      • May 2022
      • April 2022
      • March 2022
      • January 2022
      • December 2021
      • November 2021
      • October 2021
    • Translation
    • Map components
  • Testing
    • Testing guidelines
    • Critical Paths
    • GUI Tests
    • Heroku Review Apps
  • Design
    • Iconography
  • Change Proposals
  • NGPx - Template
  • NGP1 - Changing the data model (Implemented)
  • NGP2 - Presenting Geographical Hierarchies to users
  • NGP3 - Change Geography Hierarchies
  • NGP4 - Format configuration
  • NGP5 - Multiple count columns
  • NGP6 - Profile-specific open graph metadata
  • NGP7 - Wazimap profile domain management
  • NGP8 - Replacing Webflow as frontend framework
  • Tutorials
    • Creating a new profile
    • Loading new geographies
    • Loading Data
    • Creating a new admin user
    • Creating a non-admin user for a private profile
    • Changing the Geography level name
    • Deployment to Dokku
  • Configuration
  • Profile Configuration
  • Profile Indicator Configuration
  • Profile Collection Configuration
  • Geographies, hierarchies and versions
  • API
    • General API Information
    • Upload API
    • Task Status
    • Point data API
Powered by GitBook
On this page
  • Hierarchy and profile configuration considerations
  • Discussion
  • Shapefiles
  • South Africa 2020 demarcation
  • South Africa 2016 demarcation
  • South Africa 2011 demarcation
  • Equal area hexagons (Uber H3 resolution 7)

Was this helpful?

Export as PDF

Geographies, hierarchies and versions

Shapefiles to load geographies and boundaries into geography hierarchies

PreviousProfile Collection ConfigurationNextGeneral API Information

Last updated 2 years ago

Was this helpful?

See also discussion of Geography Hierarchiesarchitecture.

Hierarchy and profile configuration considerations

A profile has a geography hierarchy which represents the set of geographies it will make available to users.

A hierarchy has a root, a default demarcation version, and a full list of the versions it supports. When a user loads a profile URL, the default version will be selected. The user can change the selected version using the child type/version dropdown on the bottom right, or by selecting an indicator which only has data for that version.

A demarcation version is used to distinguish multiple versions of the same geography boundary, e.g. wards in 2011, 2016, and 2021.

A dataset is related to a specific geography hierarchy through the profile, and a specific demarcation version. The data is related to specific boundaries via the geography codes.

When loading shapefiles, they are related to a specific geography hierarchy and demarcation version by their names. Levels in the hierarchy are distinguished via the "level" field, e.g. country, ward, mainplace, equal area hexagon. All levels that have a parent in another level must be to determine their priority for selection as the current child type shown on the map when their parent geography is selected by the user.

Discussion

There are some issues with hierarchies that are beginning to show their teeth.

  • I think at least the upload script currently requires each geo to have a parent in the same version. That is probably not really necessary for the frontend or backend in normal use, it means redundant provinces and ZA boundaries, and weirdly the equal area hexagons are "in" the 2016 demarcation rather than just having the 2016 metros as their parents

  • Versions are keyed on their name, but they can only exist in one hierarchy, so to add a second "2016 Boundaries" I had to add (ye) to its name to distinguish it from another one yet be similar to its peer "2011 Boundaries" in youth explorer.

Shapefiles

These are already simplified and have the right fields to import to Wazimap.

See similarly. It also demonstrates uploading.

South Africa 2020 demarcation

The zip file says 2021 because that's the election when it took effect but the files are labeled 2020 because that's when the changes were announced by the demarcation board.

  • ZA

  • Provinces

  • Districts - district and metro municipalities

  • LocalMuni

  • Wards

Attributes

  • Name

  • Code

  • Parent_cod

  • Area

South Africa 2016 demarcation

  • za - parent is NULL to make it a root in the hierarchy

  • pr

  • dc - district and metro municipalities

  • local-mn

  • Wards_2016_geomfix

Attributes

  • code

  • parent_cod except ZA which has parent

  • name

  • area

South Africa 2011 demarcation

Equal area hexagons (Uber H3 resolution 7)

Attributes:

  • code

  • parent_cod

  • area

  • name

Resolution 7 hexagons.

Only hexagons overlapping with metros in the South Africa 2016 demarcation are included.

The metro with the greatest overlapping area was selected when multiple options were available using the QGIS Processing Toolbox > Join Attributes by location tool.

the tutorial for how to format with the appropriate attributes and simplify shapefiles
configured as "child types" of their parent in the profile configuration
3MB
2021-demarcation.zip
archive
98MB
2016-demarcation.zip
archive
579KB
hexagons-metro-children.zip
archive