|
xapian-core
1.4.30
|
Classes | |
| class | DecoderWithBoundingBox |
| A class for decoding coordinates within a bounding box. More... | |
Functions | |
| bool | encode (double lat, double lon, std::string &result) |
| Encode a coordinate and append it to a string. More... | |
| void | decode (const char *value, size_t len, double &lat_ref, double &lon_ref) |
| Decode a coordinate from a buffer. More... | |
| static void | decode (const std::string &value, double &lat_ref, double &lon_ref) |
| Decode a coordinate from a string. More... | |
| void GeoEncode::decode | ( | const char * | value, |
| size_t | len, | ||
| double & | lat_ref, | ||
| double & | lon_ref | ||
| ) |
Decode a coordinate from a buffer.
| value | A pointer to the start of the buffer to decode. |
| len | The length of the buffer in bytes. The buffer must be at least 2 bytes long (this constraint is not checked). |
| lat_ref | A reference to a value to return the latitude in. |
| lon_ref | A reference to a value to return the longitude in. |
No errors will be returned; any junk at the end of the value (ie, after the first 6 bytes) will be ignored, and it is possible for invalid inputs to result in out-of-range longitudes.
Definition at line 135 of file geoencode.cc.
Referenced by decode(), GeoEncode::DecoderWithBoundingBox::decode(), and Xapian::LatLongCoord::unserialise().
|
inlinestatic |
Decode a coordinate from a string.
| value | The string to decode. This must be at least 2 bytes long (this constraint is not checked). |
| lat_ref | A reference to a value to return the latitude in. |
| lon_ref | A reference to a value to return the longitude in. |
No errors will be returned; any junk at the end of the value (ie, after the first 6 bytes) will be ignored, and it is possible for invalid inputs to result in out-of-range longitudes.
Definition at line 80 of file geoencode.h.
References decode().
| bool GeoEncode::encode | ( | double | lat, |
| double | lon, | ||
| std::string & | result | ||
| ) |
Encode a coordinate and append it to a string.
| lat | The latitude coordinate in degrees (ranging from -90 to +90) |
| lon | The longitude coordinate in degrees (any range is valid - longitudes will be wrapped). Note that decoding will return longitudes in the range 0 <= value < 360. |
| result | The string to append the result to. |
Definition at line 73 of file geoencode.cc.
References DegreesMinutesSeconds::degrees, DegreesMinutesSeconds::minutes, rare, DegreesMinutesSeconds::sec16ths, and DegreesMinutesSeconds::seconds.
Referenced by Xapian::BitWriter::encode_interpolative(), Xapian::LatLongCoord::serialise(), and Xapian::LatLongCoords::serialise().