37 : latitude(latitude_),
40 if (latitude < -90.0 || latitude > 90.0)
49 const char * ptr = serialised.data();
50 const char * end = ptr + serialised.size();
54 "Junk found at end of serialised LatLongCoord");
60 size_t len = end - *ptr;
85 string res(
"Xapian::LatLongCoord(");
96 const char * ptr = serialised.data();
97 const char * end_ptr = ptr + serialised.size();
99 while (ptr != end_ptr) {
100 coords.emplace_back();
101 coords.back().unserialise(&ptr, end_ptr);
109 vector<LatLongCoord>::const_iterator coord;
110 for (coord = coords.begin(); coord != coords.end(); ++coord)
120 string res(
"Xapian::LatLongCoords(");
121 vector<LatLongCoord>::const_iterator coord;
122 for (coord = coords.begin(); coord != coords.end(); ++coord) {
123 if (coord != coords.begin()) {
127 res +=
str(coord->latitude);
129 res +=
str(coord->longitude);
The Xapian namespace contains public interfaces for the Xapian library.
std::string get_description() const
Return a string describing this object.
void decode(const char *value, size_t len, double &lat_ref, double &lon_ref)
Decode a coordinate from a buffer.
Convert types to std::string.
std::string serialise() const
Return a serialised representation of the coordinate.
std::string serialise() const
Return a serialised form of the coordinate list.
bool encode(double lat, double lon, std::string &result)
Encode a coordinate and append it to a string.
Hierarchy of classes which Xapian can throw as exceptions.
InvalidArgumentError indicates an invalid parameter value was passed to the API.
Geospatial search support routines.
LatLongCoord()
Construct an uninitialised coordinate.
Indicates an error in the std::string serialisation of an object.
void unserialise(const std::string &serialised)
Unserialise a string and set this object to its coordinate.
double latitude
A latitude, as decimal degrees.
string str(int value)
Convert int to std::string.
Encodings for geospatial coordinates.
std::string get_description() const
Return a string describing this object.
void unserialise(const std::string &serialised)
Unserialise a string and set this object to the coordinates in it.
double longitude
A longitude, as decimal degrees.