xapian-core
1.4.26
|
KeyMaker subclass which sorts by distance from a latitude/longitude. More...
#include <geospatial.h>
Private Attributes | |
Xapian::valueno | slot |
The value slot to read. More... | |
LatLongCoords | centre |
The centre point (or points) for distance calculation. More... | |
const LatLongMetric * | metric |
The metric to use when calculating distances. More... | |
std::string | defkey |
The default key to return, for documents with no value stored. More... | |
Additional Inherited Members | |
Public Attributes inherited from Xapian::Internal::opt_intrusive_base | |
unsigned | _refs |
Reference count. More... | |
Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base | |
void | release () const |
Start reference counting. More... | |
KeyMaker subclass which sorts by distance from a latitude/longitude.
Experimental - see https://xapian.org/docs/deprecation#experimental-features
Results are ordered by the distance from a fixed point, or list of points, calculated according to the metric supplied. If multiple points are supplied (either in the constructor, or in the coordinates stored in a document), the closest pointwise distance is used.
If a document contains no coordinate stored in the specified slot, a special value for the distance will be used. This defaults to a large number, so that such results get a low rank, but may be specified by a constructor parameter.
Definition at line 551 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
slot_ | Value slot to use. |
centre_ | List of points to calculate distance from (closest distance is used). |
metric_ | LatLongMetric to use. |
defdistance | Distance to use for docs with no value set. |
Definition at line 574 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
slot_ | Value slot to use. |
centre_ | List of points to calculate distance from (closest distance is used). |
metric_ | LatLongMetric to use. |
Documents where no value is set are assumed to be a large distance away.
Definition at line 594 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
slot_ | Value slot to use. |
centre_ | List of points to calculate distance from (closest distance is used). |
Xapian::GreatCircleMetric is used as the metric.
Documents where no value is set are assumed to be a large distance away.
Definition at line 614 of file geospatial.h.
|
inline |
Construct a LatLongDistanceKeyMaker.
slot_ | Value slot to use. |
centre_ | Point to calculate distance from. |
metric_ | LatLongMetric to use. |
defdistance | Distance to use for docs with no value set. |
Definition at line 629 of file geospatial.h.
References Xapian::LatLongCoords::append().
|
inline |
Construct a LatLongDistanceKeyMaker.
slot_ | Value slot to use. |
centre_ | Point to calculate distance from. |
metric_ | LatLongMetric to use. |
Documents where no value is set are assumed to be a large distance away.
Definition at line 650 of file geospatial.h.
References Xapian::LatLongCoords::append().
|
inline |
Construct a LatLongDistanceKeyMaker.
slot_ | Value slot to use. |
centre_ | Point to calculate distance from. |
Xapian::GreatCircleMetric is used as the metric.
Documents where no value is set are assumed to be a large distance away.
Definition at line 671 of file geospatial.h.
References Xapian::LatLongCoords::append().
LatLongDistanceKeyMaker::~LatLongDistanceKeyMaker | ( | ) |
Definition at line 46 of file latlong_distance_keymaker.cc.
|
virtual |
Build a key string for a Document.
These keys can be used for sorting or collapsing matching documents.
doc | Document object to build a key for. |
Implements Xapian::KeyMaker.
Definition at line 34 of file latlong_distance_keymaker.cc.
References Xapian::Document::get_value(), Xapian::sortable_serialise(), and Xapian::LatLongCoords::unserialise().
|
private |
The centre point (or points) for distance calculation.
Definition at line 557 of file geospatial.h.
|
private |
The default key to return, for documents with no value stored.
Definition at line 563 of file geospatial.h.
|
private |
The metric to use when calculating distances.
Definition at line 560 of file geospatial.h.
|
private |
The value slot to read.
Definition at line 554 of file geospatial.h.