Import all GB areas
2 files changed, 233 insertions(+), 5 deletions(-)

M HamDatabase.sql
M bin/overham/ccimport.pl
M HamDatabase.sql +231 -3
@@ 222,9 222,6 @@ INSERT INTO qcodes VALUES('UQ', 0, 'Shal
 INSERT INTO qcodes VALUES('UX', 0, 'Do you have any navigational warnings or gale warnings in force? [AP14]', 'I have the following navigational warning(s) or gale warning(s) in force: ... [AP14]');
 INSERT INTO qcodes VALUES('UZ', 0, 'May I resume restricted working? [AP14]', 'Distress phase still in force; restricted working may be resumed. [AP14]');
 
-CREATE TABLE countries (code CHAR(2) NOT NULL PRIMARY KEY, name VARCHAR(30) NOT NULL);
-INSERT INTO countries VALUES('GB', 'United Kingdom');
-
 CREATE TABLE bandNames (id INTEGER NOT NULL, name VARCHAR(10));
 INSERT INTO bandNames VALUES(213001, 'Amateur LF');
 INSERT INTO bandNames VALUES(213002, '160m amateur top band, MF');

          
@@ 281,3 278,234 @@ INSERT INTO bands VALUES(433014, 213014,
 INSERT INTO bands VALUES(433015, 213015, 633015, 'GB');
 INSERT INTO bands VALUES(433016, 213016, 633016, 'GB');
 INSERT INTO bands VALUES(433017, 213017, 633017, 'GB');
+
+CREATE TABLE countries (code CHAR(6) NOT NULL PRIMARY KEY, name VARCHAR(30) NOT NULL);
+INSERT INTO countries VALUES('GB', 'United Kingdom');
+INSERT INTO countries (code, name) VALUES('GB-HRW', 'Harrow');
+INSERT INTO countries (code, name) VALUES('GB-STE', 'Stoke-on-Trent');
+INSERT INTO countries (code, name) VALUES('GB-ISL', 'Islington');
+INSERT INTO countries (code, name) VALUES('GB-VGL', 'Vale of Glamorgan');
+INSERT INTO countries (code, name) VALUES('GB-BFS', 'Belfast');
+INSERT INTO countries (code, name) VALUES('GB-NIR', 'Northern Ireland');
+INSERT INTO countries (code, name) VALUES('GB-SWA', 'Swansea');
+INSERT INTO countries (code, name) VALUES('GB-WRX', 'Wrexham');
+INSERT INTO countries (code, name) VALUES('GB-SKP', 'Stockport');
+INSERT INTO countries (code, name) VALUES('GB-STN', 'Sutton');
+INSERT INTO countries (code, name) VALUES('GB-NET', 'Newcastle upon Tyne');
+INSERT INTO countries (code, name) VALUES('GB-SGC', 'South Gloucestershire');
+INSERT INTO countries (code, name) VALUES('GB-KEC', 'Kensington and Chelsea');
+INSERT INTO countries (code, name) VALUES('GB-NTT', 'Nottinghamshire');
+INSERT INTO countries (code, name) VALUES('GB-GLS', 'Gloucestershire');
+INSERT INTO countries (code, name) VALUES('GB-CCG', 'Causeway Coast and Glens');
+INSERT INTO countries (code, name) VALUES('GB-EDH', 'Edinburgh');
+INSERT INTO countries (code, name) VALUES('GB-HPL', 'Hartlepool');
+INSERT INTO countries (code, name) VALUES('GB-BNH', 'Brighton and Hove');
+INSERT INTO countries (code, name) VALUES('GB-HEF', 'Herefordshire');
+INSERT INTO countries (code, name) VALUES('GB-POL', 'Poole');
+INSERT INTO countries (code, name) VALUES('GB-BBD', 'Blackburn with Darwen');
+INSERT INTO countries (code, name) VALUES('GB-CHE', 'Cheshire East');
+INSERT INTO countries (code, name) VALUES('GB-WIL', 'Wiltshire');
+INSERT INTO countries (code, name) VALUES('GB-DEN', 'Denbighshire');
+INSERT INTO countries (code, name) VALUES('GB-STH', 'Southampton');
+INSERT INTO countries (code, name) VALUES('GB-WFT', 'Waltham Forest');
+INSERT INTO countries (code, name) VALUES('GB-BRD', 'Bradford');
+INSERT INTO countries (code, name) VALUES('GB-HIL', 'Hillingdon');
+INSERT INTO countries (code, name) VALUES('GB-RFW', 'Renfrewshire');
+INSERT INTO countries (code, name) VALUES('GB-MEA', 'Mid and East Antrim');
+INSERT INTO countries (code, name) VALUES('GB-WLL', 'Walsall');
+INSERT INTO countries (code, name) VALUES('GB-SAW', 'Sandwell');
+INSERT INTO countries (code, name) VALUES('GB-NEL', 'North East Lincolnshire');
+INSERT INTO countries (code, name) VALUES('GB-WLV', 'Wolverhampton');
+INSERT INTO countries (code, name) VALUES('GB-DRS', 'Derry and Strabane');
+INSERT INTO countries (code, name) VALUES('GB-TFW', 'Telford and Wrekin');
+INSERT INTO countries (code, name) VALUES('GB-ENG', 'England');
+INSERT INTO countries (code, name) VALUES('GB-SCB', 'Scottish Borders, The');
+INSERT INTO countries (code, name) VALUES('GB-NLK', 'North Lanarkshire');
+INSERT INTO countries (code, name) VALUES('GB-YOR', 'York');
+INSERT INTO countries (code, name) VALUES('GB-MUL', 'Mid Ulster');
+INSERT INTO countries (code, name) VALUES('GB-FMO', 'Fermanagh and Omagh');
+INSERT INTO countries (code, name) VALUES('GB-AND', 'Ards and North Down');
+INSERT INTO countries (code, name) VALUES('GB-CRY', 'Croydon');
+INSERT INTO countries (code, name) VALUES('GB-RDG', 'Reading');
+INSERT INTO countries (code, name) VALUES('GB-CWY', 'Conwy');
+INSERT INTO countries (code, name) VALUES('GB-DAL', 'Darlington');
+INSERT INTO countries (code, name) VALUES('GB-GAT', 'Gateshead');
+INSERT INTO countries (code, name) VALUES('GB-STT', 'Stockton-on-Tees');
+INSERT INTO countries (code, name) VALUES('GB-ESS', 'Essex');
+INSERT INTO countries (code, name) VALUES('GB-DER', 'Derby');
+INSERT INTO countries (code, name) VALUES('GB-LIN', 'Lincolnshire');
+INSERT INTO countries (code, name) VALUES('GB-NTH', 'Northamptonshire');
+INSERT INTO countries (code, name) VALUES('GB-BDG', 'Barking and Dagenham');
+INSERT INTO countries (code, name) VALUES('GB-IOS', 'Isles of Scilly');
+INSERT INTO countries (code, name) VALUES('GB-WLS', 'Wales');
+INSERT INTO countries (code, name) VALUES('GB-MON', 'Monmouthshire');
+INSERT INTO countries (code, name) VALUES('GB-BRY', 'Bromley');
+INSERT INTO countries (code, name) VALUES('GB-NAY', 'North Ayrshire');
+INSERT INTO countries (code, name) VALUES('GB-BIR', 'Birmingham');
+INSERT INTO countries (code, name) VALUES('GB-OLD', 'Oldham');
+INSERT INTO countries (code, name) VALUES('GB-HRY', 'Haringey');
+INSERT INTO countries (code, name) VALUES('GB-SCT', 'Scotland');
+INSERT INTO countries (code, name) VALUES('GB-SAY', 'South Ayrshire');
+INSERT INTO countries (code, name) VALUES('GB-NGM', 'Nottingham');
+INSERT INTO countries (code, name) VALUES('GB-CHW', 'Cheshire West and Chester');
+INSERT INTO countries (code, name) VALUES('GB-BMH', 'Bournemouth');
+INSERT INTO countries (code, name) VALUES('GB-WAR', 'Warwickshire');
+INSERT INTO countries (code, name) VALUES('GB-WNM', 'Windsor and Maidenhead');
+INSERT INTO countries (code, name) VALUES('GB-NYK', 'North Yorkshire');
+INSERT INTO countries (code, name) VALUES('GB-BOL', 'Bolton');
+INSERT INTO countries (code, name) VALUES('GB-HAL', 'Halton');
+INSERT INTO countries (code, name) VALUES('GB-UKM', 'United Kingdom');
+INSERT INTO countries (code, name) VALUES('GB-DUR', 'Durham, County');
+INSERT INTO countries (code, name) VALUES('GB-LIV', 'Liverpool');
+INSERT INTO countries (code, name) VALUES('GB-CON', 'Cornwall');
+INSERT INTO countries (code, name) VALUES('GB-SFK', 'Suffolk');
+INSERT INTO countries (code, name) VALUES('GB-CMN', 'Carmarthenshire');
+INSERT INTO countries (code, name) VALUES('GB-WRT', 'Warrington');
+INSERT INTO countries (code, name) VALUES('GB-DGY', 'Dumfries and Galloway');
+INSERT INTO countries (code, name) VALUES('GB-THR', 'Thurrock');
+INSERT INTO countries (code, name) VALUES('GB-BNE', 'Barnet');
+INSERT INTO countries (code, name) VALUES('GB-NLN', 'North Lincolnshire');
+INSERT INTO countries (code, name) VALUES('GB-TAM', 'Tameside');
+INSERT INTO countries (code, name) VALUES('GB-ORK', 'Orkney Islands');
+INSERT INTO countries (code, name) VALUES('GB-HRT', 'Hertfordshire');
+INSERT INTO countries (code, name) VALUES('GB-NWM', 'Newham');
+INSERT INTO countries (code, name) VALUES('GB-NFK', 'Norfolk');
+INSERT INTO countries (code, name) VALUES('GB-SOL', 'Solihull');
+INSERT INTO countries (code, name) VALUES('GB-IOM', 'Isle of Man');
+INSERT INTO countries (code, name) VALUES('GB-ANS', 'Angus');
+INSERT INTO countries (code, name) VALUES('GB-NTL', 'Neath Port Talbot');
+INSERT INTO countries (code, name) VALUES('GB-POW', 'Powys');
+INSERT INTO countries (code, name) VALUES('GB-TOF', 'Torfaen');
+INSERT INTO countries (code, name) VALUES('GB-MTY', 'Merthyr Tydfil');
+INSERT INTO countries (code, name) VALUES('GB-SOM', 'Somerset');
+INSERT INTO countries (code, name) VALUES('GB-CMD', 'Camden');
+INSERT INTO countries (code, name) VALUES('GB-BKM', 'Buckinghamshire');
+INSERT INTO countries (code, name) VALUES('GB-SOS', 'Southend-on-Sea');
+INSERT INTO countries (code, name) VALUES('GB-GBN', 'Great Britain');
+INSERT INTO countries (code, name) VALUES('GB-GSY', 'Guernsey');
+INSERT INTO countries (code, name) VALUES('GB-HLD', 'Highland');
+INSERT INTO countries (code, name) VALUES('GB-RUT', 'Rutland');
+INSERT INTO countries (code, name) VALUES('GB-SHN', 'St. Helens');
+INSERT INTO countries (code, name) VALUES('GB-RDB', 'Redbridge');
+INSERT INTO countries (code, name) VALUES('GB-DND', 'Dundee City');
+INSERT INTO countries (code, name) VALUES('GB-TOB', 'Torbay');
+INSERT INTO countries (code, name) VALUES('GB-AGB', 'Argyll and Bute');
+INSERT INTO countries (code, name) VALUES('GB-LAN', 'Lancashire');
+INSERT INTO countries (code, name) VALUES('GB-BRC', 'Bracknell Forest');
+INSERT INTO countries (code, name) VALUES('GB-NWP', 'Newport');
+INSERT INTO countries (code, name) VALUES('GB-ABD', 'Aberdeenshire');
+INSERT INTO countries (code, name) VALUES('GB-SRY', 'Surrey');
+INSERT INTO countries (code, name) VALUES('GB-WRL', 'Wirral');
+INSERT INTO countries (code, name) VALUES('GB-CMA', 'Cumbria');
+INSERT INTO countries (code, name) VALUES('GB-KEN', 'Kent');
+INSERT INTO countries (code, name) VALUES('GB-CRF', 'Cardiff');
+INSERT INTO countries (code, name) VALUES('GB-NMD', 'Newry, Mourne and Down');
+INSERT INTO countries (code, name) VALUES('GB-BEN', 'Brent');
+INSERT INTO countries (code, name) VALUES('GB-SLG', 'Slough');
+INSERT INTO countries (code, name) VALUES('GB-OXF', 'Oxfordshire');
+INSERT INTO countries (code, name) VALUES('GB-BDF', 'Bedford');
+INSERT INTO countries (code, name) VALUES('GB-POR', 'Portsmouth');
+INSERT INTO countries (code, name) VALUES('GB-SHR', 'Shropshire');
+INSERT INTO countries (code, name) VALUES('GB-RIC', 'Richmond upon Thames');
+INSERT INTO countries (code, name) VALUES('GB-EDU', 'East Dunbartonshire');
+INSERT INTO countries (code, name) VALUES('GB-MDB', 'Middlesbrough');
+INSERT INTO countries (code, name) VALUES('GB-STY', 'South Tyneside');
+INSERT INTO countries (code, name) VALUES('GB-ESX', 'East Sussex');
+INSERT INTO countries (code, name) VALUES('GB-LEC', 'Leicestershire');
+INSERT INTO countries (code, name) VALUES('GB-NSM', 'North Somerset');
+INSERT INTO countries (code, name) VALUES('GB-FLN', 'Flintshire');
+INSERT INTO countries (code, name) VALUES('GB-DUD', 'Dudley');
+INSERT INTO countries (code, name) VALUES('GB-IOW', 'Isle of Wight');
+INSERT INTO countries (code, name) VALUES('GB-LBC', 'Lisburn and Castlereagh');
+INSERT INTO countries (code, name) VALUES('GB-WND', 'Wandsworth	London borough');
+INSERT INTO countries (code, name) VALUES('GB-RCT', 'Rhondda, Cynon, Taff');
+INSERT INTO countries (code, name) VALUES('GB-WBK', 'West Berkshire');
+INSERT INTO countries (code, name) VALUES('GB-SND', 'Sunderland');
+INSERT INTO countries (code, name) VALUES('GB-HMF', 'Hammersmith and Fulham');
+INSERT INTO countries (code, name) VALUES('GB-WSM', 'Westminster');
+INSERT INTO countries (code, name) VALUES('GB-ROT', 'Rotherham');
+INSERT INTO countries (code, name) VALUES('GB-EAL', 'Ealing');
+INSERT INTO countries (code, name) VALUES('GB-DBY', 'Derbyshire');
+INSERT INTO countries (code, name) VALUES('GB-KHL', 'Kingston upon Hull');
+INSERT INTO countries (code, name) VALUES('GB-TRF', 'Trafford');
+INSERT INTO countries (code, name) VALUES('GB-LUT', 'Luton');
+INSERT INTO countries (code, name) VALUES('GB-ELS', 'Eilean Siar');
+INSERT INTO countries (code, name) VALUES('GB-SWK', 'Southwark');
+INSERT INTO countries (code, name) VALUES('GB-DNC', 'Doncaster');
+INSERT INTO countries (code, name) VALUES('GB-GLG', 'Glasgow City');
+INSERT INTO countries (code, name) VALUES('GB-BNS', 'Barnsley');
+INSERT INTO countries (code, name) VALUES('GB-RCH', 'Rochdale');
+INSERT INTO countries (code, name) VALUES('GB-DEV', 'Devon');
+INSERT INTO countries (code, name) VALUES('GB-CGN', 'Ceredigion');
+INSERT INTO countries (code, name) VALUES('GB-BGE', 'Bridgend');
+INSERT INTO countries (code, name) VALUES('GB-BST', 'Bristol, City of');
+INSERT INTO countries (code, name) VALUES('GB-WSX', 'West Sussex');
+INSERT INTO countries (code, name) VALUES('GB-BAS', 'Bath and North East Somerset');
+INSERT INTO countries (code, name) VALUES('GB-TWH', 'Tower Hamlets');
+INSERT INTO countries (code, name) VALUES('GB-ELN', 'East Lothian');
+INSERT INTO countries (code, name) VALUES('GB-HNS', 'Hounslow');
+INSERT INTO countries (code, name) VALUES('GB-MIK', 'Milton Keynes');
+INSERT INTO countries (code, name) VALUES('GB-SHF', 'Sheffield');
+INSERT INTO countries (code, name) VALUES('GB-IVC', 'Inverclyde');
+INSERT INTO countries (code, name) VALUES('GB-SFT', 'Sefton');
+INSERT INTO countries (code, name) VALUES('GB-COV', 'Coventry');
+INSERT INTO countries (code, name) VALUES('GB-WLN', 'West Lothian');
+INSERT INTO countries (code, name) VALUES('GB-STG', 'Stirling');
+INSERT INTO countries (code, name) VALUES('GB-MAN', 'Manchester');
+INSERT INTO countries (code, name) VALUES('GB-FIF', 'Fife');
+INSERT INTO countries (code, name) VALUES('GB-WGN', 'Wigan');
+INSERT INTO countries (code, name) VALUES('GB-CLK', 'Clackmannanshire');
+INSERT INTO countries (code, name) VALUES('GB-GRE', 'Greenwich');
+INSERT INTO countries (code, name) VALUES('GB-MDW', 'Medway');
+INSERT INTO countries (code, name) VALUES('GB-KTT', 'Kingston upon Thames');
+INSERT INTO countries (code, name) VALUES('GB-ABE', 'Aberdeen City');
+INSERT INTO countries (code, name) VALUES('GB-MRT', 'Merton');
+INSERT INTO countries (code, name) VALUES('GB-ENF', 'Enfield');
+INSERT INTO countries (code, name) VALUES('GB-ANN', 'Antrim and Newtownabbey');
+INSERT INTO countries (code, name) VALUES('GB-JSY', 'Jersey');
+INSERT INTO countries (code, name) VALUES('GB-ERY', 'East Riding of Yorkshire');
+INSERT INTO countries (code, name) VALUES('GB-HCK', 'Hackney');
+INSERT INTO countries (code, name) VALUES('GB-FAL', 'Falkirk');
+INSERT INTO countries (code, name) VALUES('GB-MRY', 'Moray');
+INSERT INTO countries (code, name) VALUES('GB-LCE', 'Leicester');
+INSERT INTO countries (code, name) VALUES('GB-KWL', 'Knowsley');
+INSERT INTO countries (code, name) VALUES('GB-AGY', 'Isle of Anglesey');
+INSERT INTO countries (code, name) VALUES('GB-LBH', 'Lambeth');
+INSERT INTO countries (code, name) VALUES('GB-CLD', 'Calderdale');
+INSERT INTO countries (code, name) VALUES('GB-LDS', 'Leeds');
+INSERT INTO countries (code, name) VALUES('GB-PKN', 'Perth and Kinross');
+INSERT INTO countries (code, name) VALUES('GB-LND', 'London, City of');
+INSERT INTO countries (code, name) VALUES('GB-WOR', 'Worcestershire');
+INSERT INTO countries (code, name) VALUES('GB-HAM', 'Hampshire');
+INSERT INTO countries (code, name) VALUES('GB-CAM', 'Cambridgeshire');
+INSERT INTO countries (code, name) VALUES('GB-WDU', 'West Dunbartonshire');
+INSERT INTO countries (code, name) VALUES('GB-BEX', 'Bexley');
+INSERT INTO countries (code, name) VALUES('GB-LEW', 'Lewisham');
+INSERT INTO countries (code, name) VALUES('GB-SLK', 'South Lanarkshire');
+INSERT INTO countries (code, name) VALUES('GB-STS', 'Staffordshire');
+INSERT INTO countries (code, name) VALUES('GB-DOR', 'Dorset');
+INSERT INTO countries (code, name) VALUES('GB-SLF', 'Salford');
+INSERT INTO countries (code, name) VALUES('GB-NTY', 'North Tyneside');
+INSERT INTO countries (code, name) VALUES('GB-PEM', 'Pembrokeshire');
+INSERT INTO countries (code, name) VALUES('GB-RCC', 'Redcar and Cleveland');
+INSERT INTO countries (code, name) VALUES('GB-BGW', 'Blaenau Gwent');
+INSERT INTO countries (code, name) VALUES('GB-MLN', 'Midlothian	council area');
+INSERT INTO countries (code, name) VALUES('GB-PLY', 'Plymouth');
+INSERT INTO countries (code, name) VALUES('GB-HAV', 'Havering');
+INSERT INTO countries (code, name) VALUES('GB-ZET', 'Shetland Islands');
+INSERT INTO countries (code, name) VALUES('GB-ERW', 'East Renfrewshire');
+INSERT INTO countries (code, name) VALUES('GB-CBF', 'Central Bedfordshire');
+INSERT INTO countries (code, name) VALUES('GB-CAY', 'Caerphilly');
+INSERT INTO countries (code, name) VALUES('GB-KIR', 'Kirklees');
+INSERT INTO countries (code, name) VALUES('GB-SWD', 'Swindon');
+INSERT INTO countries (code, name) VALUES('GB-ABC', 'Armagh, Banbridge and Craigavon');
+INSERT INTO countries (code, name) VALUES('GB-BUR', 'Bury');
+INSERT INTO countries (code, name) VALUES('GB-CHA', 'Channel Islands');
+INSERT INTO countries (code, name) VALUES('GB-EAY', 'East Ayrshire');
+INSERT INTO countries (code, name) VALUES('GB-EAW', 'England and Wales');
+INSERT INTO countries (code, name) VALUES('GB-BPL', 'Blackpool');
+INSERT INTO countries (code, name) VALUES('GB-WOK', 'Wokingham');
+INSERT INTO countries (code, name) VALUES('GB-WKF', 'Wakefield');
+INSERT INTO countries (code, name) VALUES('GB-PTE', 'Peterborough');
+INSERT INTO countries (code, name) VALUES('GB-NBL', 'Northumberland');
+INSERT INTO countries (code, name) VALUES('GB-GWN', 'Gwynedd');

          
M bin/overham/ccimport.pl +2 -2
@@ 53,8 53,8 @@ sub makeInserts {
 	my ($info) = @_;
 
 	while (my ($ident, $hash) = each(%$info)) {
-		printf("INSERT INTO cc (cc, en, type) VALUES('%s', '%s', '%s');\n",
-		    $ident, $info->{$ident}->{fullDesc}, $info->{$ident}->{fullDesc});
+		printf("INSERT INTO countries (code, name) VALUES('%s', '%s');\n",
+		    $ident, $info->{$ident}->{fullDesc});
 	}
 }