xapian-core
1.4.26
|
A class for decoding coordinates within a bounding box. More...
#include <geoencode.h>
Public Member Functions | |
DecoderWithBoundingBox (double lat1, double lon1, double lat2, double lon2) | |
Create a decoder with a bounding box. More... | |
bool | decode (const std::string &value, double &lat_ref, double &lon_ref) const |
Decode a coordinate. More... | |
Private Attributes | |
double | lon1 |
Longitude at western edge of bounding box. More... | |
double | lon2 |
Longitude at eastern edge of bounding box. More... | |
double | min_lat |
Minimum latitude in bounding box. More... | |
double | max_lat |
Maximum latitude in bounding box. More... | |
unsigned char | start1 |
First byte of encoded form of coordinates with lon1. More... | |
unsigned char | start2 |
First byte of encoded form of coordinates with lon2. More... | |
bool | include_poles |
True if either of the poles are included in the range. More... | |
bool | discontinuous_longitude_range |
Flag; true if the longitude range is discontinuous (ie, goes over the boundary at which longitudes wrap from 360 to 0). More... | |
A class for decoding coordinates within a bounding box.
This class aborts decoding if it is easily able to determine that the encoded coordinate supplied is outside the bounding box, avoiding some unnecessary work.
Definition at line 91 of file geoencode.h.
GeoEncode::DecoderWithBoundingBox::DecoderWithBoundingBox | ( | double | lat1, |
double | lon1, | ||
double | lat2, | ||
double | lon2 | ||
) |
Create a decoder with a bounding box.
The decoder will decode any encoded coordinates which lie inside the bounding box, and return false for any which lie outside the bounding box.
lat1 | The latitude of the southern edge of the bounding box. |
lon1 | The longitude of the western edge of the bounding box. |
lat2 | The latitude of the northern edge of the bounding box. |
lon2 | The longitude of the eastern edge of the bounding box. |
Definition at line 190 of file geoencode.cc.
References calc_latlon_16ths().
Referenced by calc_latlon_16ths().
bool GeoEncode::DecoderWithBoundingBox::decode | ( | const std::string & | value, |
double & | lat_ref, | ||
double & | lon_ref | ||
) | const |
Decode a coordinate.
value | The coordinate to decode. |
lat_ref | A reference to a value to return the latitude in. |
lon_ref | A reference to a value to return the longitude in. |
Note; if this returns false, the values of lat_ref and lon_ref may not have been updated, or may have been updated to incorrect values, due to aborting decoding of the coordinate part-way through.
Definition at line 226 of file geoencode.cc.
References GeoEncode::decode().
|
private |
Flag; true if the longitude range is discontinuous (ie, goes over the boundary at which longitudes wrap from 360 to 0).
Definition at line 123 of file geoencode.h.
|
private |
True if either of the poles are included in the range.
Definition at line 118 of file geoencode.h.
|
private |
Longitude at western edge of bounding box.
Definition at line 94 of file geoencode.h.
|
private |
Longitude at eastern edge of bounding box.
Definition at line 98 of file geoencode.h.
|
private |
Maximum latitude in bounding box.
Definition at line 106 of file geoencode.h.
|
private |
Minimum latitude in bounding box.
Definition at line 102 of file geoencode.h.
|
private |
First byte of encoded form of coordinates with lon1.
Definition at line 110 of file geoencode.h.
|
private |
First byte of encoded form of coordinates with lon2.
Definition at line 114 of file geoencode.h.