Skip to content

Boundary Reviews (2)

Will Roper edited this page Nov 29, 2021 · 2 revisions

After the first election using a new set of boundaries has happened, a BoundaryLine release will be published containing the finalised boundaries and GSS codes. When this happens, we want to retrospectively replace the LGBCE boundaries and temp codes with GSS codes and boundaries from Ordnance Survey. There are 2 steps to this process:

1. Replace temp ids with GSS codes

boundaryline_backport_codes takes a reference date and a BoundaryLine release. The reference date is used to work out which DivisionSets are valid for the BoundaryLine release so should be after the start date of the relevant DivisionSets e.g:

manage.py boundaryline_backport_codes 2018-05-04 -u "http://parlvid.mysociety.org/os/bdline_gb-2018-05.zip"

NB 2018-05-04 is the Friday after an election Thursday - which will be the start date for lot's of DivisionSets

  • Pass --dry-run to get a report of what it will do without commiting changes
  • Pass -v 2 for extra debug info
  • There will usually be a handful of areas which we couldn't automatically attach a code to. These will require manual follow-up. Usually these will be due to minor differences in the ward name between the LGBCE data and BoundaryLine. The remaining manual edits can be made via /admin

2. Replace temp boundaries with OS boundaries

Once we've replaced the temp identifiers with gss codes, we can use those GSS codes to import boundaries from BoundaryLine e.g:

manage.py boundaryline_import_boundaries --source "bdline_gb-2018-05" --codes "myfile.json" -u "http://parlvid.mysociety.org/os/bdline_gb-2018-05.zip"
  • --codes accepts a path to a local JSON file containing an array of codes e.g: ["gss:X01000001", "gss:X01000002"]
  • If a GSS code exists attached to multiple Division records, those divisions will be ignored by default and we'll need to re-run the import with the --all flag (but check them first!)