The constituency->town mapping importer (ImportConstituencyTownMappingsCommand.php) matches towns to constituencies based on names alone (i.e. no IDs):
|
$town = Town::where('name', $row['town_name'])->first(); |
This will cause some towns to be mismatched, because there are often towns with the same name in different places (e.g. there are 12 towns called “Wick” in the database).
Given we have lat-long values for towns, we could instead run the towns through one of the mappers mentioned in the README to get the constituency. I guess that hasn’t been done because some towns straddle more than one constituency, and that’s why the relationship is many-to-many?