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) {
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);
InvalidArgumentError indicates an invalid parameter value was passed to the API.
void unserialise(const std::string &serialised)
Unserialise a string and set this object to the coordinates in it.
std::string serialise() const
Return a serialised form of the coordinate list.
std::string get_description() const
Return a string describing this object.
std::vector< LatLongCoord > coords
The coordinates.
Indicates an error in the std::string serialisation of an object.
Hierarchy of classes which Xapian can throw as exceptions.
Encodings for geospatial coordinates.
Geospatial search support routines.
bool encode(double lat, double lon, std::string &result)
Encode a coordinate and append it to a string.
void decode(const char *value, size_t len, double &lat_ref, double &lon_ref)
Decode a coordinate from a buffer.
string str(int value)
Convert int to std::string.
The Xapian namespace contains public interfaces for the Xapian library.
Convert types to std::string.
void unserialise(const std::string &serialised)
Unserialise a string and set this object to its coordinate.
std::string get_description() const
Return a string describing this object.
LatLongCoord()
Construct an uninitialised coordinate.
double latitude
A latitude, as decimal degrees.
double longitude
A longitude, as decimal degrees.
std::string serialise() const
Return a serialised representation of the coordinate.