9.2.12 Distance Comparison with Kilometer Tolerance  'FieldComparatorDistance'

Using locality information from external sources, distance comparison can be calculated when postcodes or similar fields are available in data sets. This field comparator uses a geocode look-up table (where for each entry longitude and latitude are stored) to calculate the distance in kilometers between two values. The argument geocode_table must be set to a reference to a geocode look-up table as defined and loaded using methods from the lookup.py module (see Chapter 14 for more details).

An additional argument is max_distance (a positive number in kilometers) which gives the maximum distance that is tolerated. If the calculated distance between two fields is equal to or less than the value in max_distance, a partial agreement weight is calculated using the following formula.

\begin{eqnarray*}
partial\_agreement & = & agree\_weight - \left(
\frac{distanc...
...0} \right)
* \\
~& ~& (agree\_weight + abs(disagree\_weight))
\end{eqnarray*}


If the distance is larger than max_distance, the disagreement weight is returned.

In its current version no frequency dependent weight calculation is possible, thus the arguments frequency_table, freq_table_max_weight and freq_table_min_weight can not be used with this field comparator function.