Geo::Coder::Many::Util
Miscellaneous routines that are convenient for, for example, generating commonly used callback methods to be used with Geo::Coder::Many.
Constructs a result filter callback which only passes results which exceed the specified precision.
Constructs a result filter callback which only passes results with the specified 'country' value.
A picker callback that requests all available results, and then picks the one with the highest precision. Note that querying all available geocoders may take a comparatively long time.
Example:
$geo_multiple->set_picker_callback( \&max_precision_picker );
Returns a picker callback that requires at least 'required_consensus' separate geocoder results to be within a bounding square of side-length 'nearness'. If this can be satisfied, the result from that square which has the highest precision will be returned. Otherwise, asks for more/returns undef.
WARNING: quadratic time in length of @$ra_results - could be improved if necessary.
$geo_multiple->set_picker_callback( consensus_picker({nearness => 0.1, required_consensus => 2}) );
Used by consensus_picker - returns true iff ($lat, $lon) is inside the square with centre ($centre_lat, $centre_lon) and side length 2*$half_width.
Given a reference to an array of result hashes, returns the one with the highest precision value
To install Geo::Coder::Many, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Coder::Many
CPAN shell
perl -MCPAN -e shell install Geo::Coder::Many
For more information on module installation, please visit the detailed CPAN module installation guide.