Ignore candidates from divisions outside Victoria.
This commit is contained in:
@@ -46,6 +46,7 @@ function match_lga(&$candidate_data, $lga_list) {
|
||||
foreach ($candidate_data as &$candidate) {
|
||||
/* Match user typed LGA/Ward to our database */
|
||||
$max_score = 0;
|
||||
$match_lga = null;
|
||||
foreach ($lga_list as $lga) {
|
||||
$aa = preg_split("/[^a-z]/", strtolower($candidate['Division']));
|
||||
$bb = preg_split("/[^a-z]/", $lga['slug']);
|
||||
@@ -76,7 +77,11 @@ function match_lga(&$candidate_data, $lga_list) {
|
||||
}
|
||||
*/
|
||||
|
||||
$candidate['match_division'] = $match_lga['slug'];
|
||||
if ($match_lga === null) {
|
||||
$candidate['match_division'] = "no_match";
|
||||
} else {
|
||||
$candidate['match_division'] = $match_lga['slug'];
|
||||
}
|
||||
//$candidate['match_ward'] = $match_ward;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,11 @@ for key in $(jq -r 'keys[]' <<< $image_map) ; do
|
||||
esac
|
||||
|
||||
lga=$(jq -r ".[\"$key\"][\"match_division\"]" <<< $image_map)
|
||||
|
||||
if [ ! -d $"$DATA_PATH/$lga" ] ; then
|
||||
continue
|
||||
fi
|
||||
|
||||
dst="$DATA_PATH/$lga/$key$suffix"
|
||||
|
||||
if [ -f $dst ] ; then
|
||||
|
||||
Reference in New Issue
Block a user