From d8cbda9d8e75518edc08084b8073f49b6eb34f1e Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 5 Dec 2014 15:33:35 +0000 Subject: [PATCH] [UK] Boundary-Line October 2014 import. Adapt the already used Torfaen script to deal with the fact the October edition of Boundary-Line appears to revert all of the Torfaen Order, not just parts of it. --- mapit_gb/controls/2014-10.py | 13 ++++++++ .../commands/mapit_UK_fix_2014-05-torfaen.py | 33 +++++++++++++------ 2 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 mapit_gb/controls/2014-10.py diff --git a/mapit_gb/controls/2014-10.py b/mapit_gb/controls/2014-10.py new file mode 100644 index 00000000..5fe678a5 --- /dev/null +++ b/mapit_gb/controls/2014-10.py @@ -0,0 +1,13 @@ +# A control file for importing October 2014 Boundary-Line. + +# This control file assumes previous Boundary-Lines have been imported, +# because it uses that information. If this is a first import, use the +# first-gss control file. + + +def code_version(): + return 'gss' + + +def check(name, type, country, geometry): + return False diff --git a/mapit_gb/management/commands/mapit_UK_fix_2014-05-torfaen.py b/mapit_gb/management/commands/mapit_UK_fix_2014-05-torfaen.py index fabbc357..7ab4eac5 100644 --- a/mapit_gb/management/commands/mapit_UK_fix_2014-05-torfaen.py +++ b/mapit_gb/management/commands/mapit_UK_fix_2014-05-torfaen.py @@ -1,15 +1,15 @@ -# This script is to be run as a one-off to fix up some of the changes to -# Torfaen wards/communities in the May 2014 edition of Boundary-Line that -# should not have been present. +# This script is to be run as a one-off to revert the changes to Torfaen +# wards/communities in the May 2014 edition of Boundary-Line. Only some of them +# should not have been present, but they've all been reverted in the October +# edition. # # http://www.legislation.gov.uk/wsi/2013/2156/contents/made is the source for # all of this. Specifically, section 2 saying that articles 5, 6 and 10 don't # come into operation until before the next election, which is 2017. # -# This script will revoke the changes made for the purposes of articles 5 and -# 6, but the changes for article 10 overlap with changes for (active) articles -# 8 and 9, so we will live with those being incorrect until Ordnance Survey -# release hopefully fixed boundaries in October. +# This script will revoke the changes made for the purposes of articles 5-10 +# (originally this script only revoked 5 and 6, leaving 10 as it overlapped +# with 8/9). from optparse import make_option from django.core.management.base import NoArgsCommand @@ -23,7 +23,7 @@ def disp(areas): class Command(NoArgsCommand): - help = 'Fix some of the Torfaen wards in the May 2014 UK Boundary-Line import' + help = 'Fix the Torfaen wards in the May 2014 UK Boundary-Line import' option_list = NoArgsCommand.option_list + ( make_option('--commit', action='store_true', dest='commit', help='Actually update the database'), ) @@ -56,9 +56,22 @@ def handle_noargs(self, **options): self.move('Llanyrafon', 'UTE', True) # Article 7 moved some of Abersychan to Pen Tranch (Snatchwood UTE) + self.move('Abersychan Community', 'CPC') + self.move('Abersychan', 'UTE') + self.move('Pen Tranch Community', 'CPC') + self.move('Snatchwood', 'UTE') + # Article 8 moved some of Upper Cwmbran to Pontnewydd + self.move('Upper Cwmbran Community', 'CPC') + self.move('Upper Cwmbran', 'UTE') + self.move('Pontnewydd Community', 'CPC') + self.move('Pontnewydd', 'UTE') + # Article 9 moved some of Fairwater to Cwmbran Central (Greenmeadow to St Dials UTEs) - # These three have come into operation. + self.move('Fairwater Community', 'CPC') + self.move('Greenmeadow', 'UTE') + self.move('Cwmbran Central Community', 'CPC') + self.move('St Dials', 'UTE') # Article 10 moved some of Fairwater to Upper Cwmbran (Greenmeadow to Upper Cwmbran UTEs) - # Not reverting article 10 changes, see above + # Covered by movements for articles 8 and 9