NAME

Geo::Coder::Free::Provenance - The provenance keys that every Geo::Coder::Free result carries

DESCRIPTION

Which distribution and which backend produced a result, how good the match was and how precise the coordinate is: the keys of section 2.1 of BI-Phase6-Dependency-Specs.md, and the vocabulary they speak.

use Geo::Coder::Free::Provenance qw(GEOCODER);

my $point = Geo::Location::Point->new({
    geocoder   => GEOCODER,
    database   => 'OpenAddresses',
    confidence => 1.0,
    accuracy   => Geo::Location::Point::accuracy_for(qw(house_number road city)),
});

Geo::Coder::Free->provenance($point) reads the four keys back, so a consumer does not have to know them.

These two live here rather than in Geo::Coder::Free::Utils because Utils is synced from VWF master, where the provenance of a geocoder result has no meaning; an addition there would be lost the next time that sync runs.

VERSION

Version 0.51

SUBROUTINES/METHODS

GEOCODER

The distribution that produced a result: Geo::Coder::Free. It is the geocoder key of every result this distribution returns, whether the answer came from OpenAddresses, Local or MaxMind.

ACCURACY_LEVELS

A list of the accuracies a result may claim, most precise first: address, street, postcode, locality, city, region and country.

It is Geo::Location::Point::ACCURACY_LEVELS(), the list that module validates an accuracy against, re-exported here so that a backend can describe the match it made without knowing which module the vocabulary is defined in. There is one list behind both names, not a copy of it.

The rule that turns the fields a match was made on into one of these levels is Geo::Location::Point::accuracy_for(), which lives beside the list it returns a level from. This module reports the accuracy key; it does not decide what the key may hold.

AUTHOR

Nigel Horne, <njh at nigelhorne.com>

LICENSE AND COPYRIGHT

Copyright 2017-2026 Nigel Horne.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.