A class to manage world scenery tiling. More...
#include <newbucket.hxx>
Public Member Functions | |
SGBucket () | |
Default constructor. | |
SGBucket (const double dlon, const double dlat) | |
Construct a bucket given a specific location. | |
SGBucket (const SGGeod &geod) | |
Construct a bucket given a specific location. | |
SGBucket (const bool is_good) | |
Construct a bucket. | |
SGBucket (const long int bindex) | |
Construct a bucket given a unique bucket index number. | |
void | set_bucket (double dlon, double dlat) |
Reset a bucket to represent a new lat and lon. | |
void | set_bucket (double *lonlat) |
Reset a bucket to represent a new lat and lon. | |
void | set_bucket (const SGGeod &geod) |
Reset a bucket to represent a new lat and lon. | |
void | make_bad () |
Create an impossible bucket. | |
long int | gen_index () const |
Generate the unique scenery tile index for this bucket. | |
std::string | gen_index_str () const |
Generate the unique scenery tile index for this bucket in ascii string form. | |
std::string | gen_base_path () const |
Build the base path name for this bucket. | |
double | get_center_lon () const |
double | get_center_lat () const |
double | get_width () const |
double | get_height () const |
double | get_width_m () const |
double | get_height_m () const |
SGGeod | get_center () const |
SGGeod | get_corner (unsigned num) const |
int | get_chunk_lon () const |
int | get_chunk_lat () const |
int | get_x () const |
int | get_y () const |
Related Functions | |
(Note that these are not member functions.) | |
SGBucket | sgBucketOffset (double dlon, double dlat, int x, int y) |
void | sgBucketDiff (const SGBucket &b1, const SGBucket &b2, int *dx, int *dy) |
A class to manage world scenery tiling.
This class encapsulates the world tiling scheme. It provides ways to calculate a unique tile index from a lat/lon, and it can provide information such as the dimensions of a given tile.
Definition at line 95 of file newbucket.hxx.
SGBucket::SGBucket | ( | const double | dlon, | |
const double | dlat | |||
) |
Construct a bucket given a specific location.
dlon | longitude specified in degrees | |
dlat | latitude specified in degrees |
Definition at line 43 of file newbucket.cxx.
SGBucket::SGBucket | ( | const SGGeod & | geod | ) |
Construct a bucket given a specific location.
dlon | longitude specified in degrees | |
dlat | latitude specified in degrees |
Definition at line 47 of file newbucket.cxx.
SGBucket::SGBucket | ( | const bool | is_good | ) |
Construct a bucket.
is_good | if false, create an invalid bucket. This is useful * if you are comparing cur_bucket to last_bucket and you want to * make sure last_bucket starts out as something impossible. |
Definition at line 52 of file newbucket.cxx.
SGBucket::SGBucket | ( | const long int | bindex | ) |
Construct a bucket given a unique bucket index number.
bindex | unique bucket index |
Definition at line 61 of file newbucket.cxx.
string SGBucket::gen_base_path | ( | ) | const |
Build the base path name for this bucket.
Definition at line 142 of file newbucket.cxx.
long int SGBucket::gen_index | ( | ) | const [inline] |
Generate the unique scenery tile index for this bucket.
The index is constructed as follows:
9 bits - to represent 360 degrees of longitude (-180 to 179) 8 bits - to represent 180 degrees of latitude (-90 to 89)
Each 1 degree by 1 degree tile is further broken down into an 8x8 grid. So we also need:
3 bits - to represent x (0 to 7) 3 bits - to represent y (0 to 7)
Definition at line 184 of file newbucket.hxx.
std::string SGBucket::gen_index_str | ( | ) | const [inline] |
Generate the unique scenery tile index for this bucket in ascii string form.
Definition at line 193 of file newbucket.hxx.
SGGeod SGBucket::get_center | ( | ) | const [inline] |
Definition at line 250 of file newbucket.hxx.
double SGBucket::get_center_lat | ( | ) | const [inline] |
Definition at line 223 of file newbucket.hxx.
double SGBucket::get_center_lon | ( | ) | const [inline] |
Definition at line 210 of file newbucket.hxx.
int SGBucket::get_chunk_lat | ( | ) | const [inline] |
Definition at line 276 of file newbucket.hxx.
int SGBucket::get_chunk_lon | ( | ) | const [inline] |
Definition at line 270 of file newbucket.hxx.
SGGeod SGBucket::get_corner | ( | unsigned | num | ) | const [inline] |
Definition at line 256 of file newbucket.hxx.
double SGBucket::get_height | ( | ) | const |
Definition at line 197 of file newbucket.cxx.
double SGBucket::get_height_m | ( | ) | const |
Definition at line 221 of file newbucket.cxx.
double SGBucket::get_width | ( | ) | const |
Definition at line 191 of file newbucket.cxx.
double SGBucket::get_width_m | ( | ) | const |
Definition at line 203 of file newbucket.cxx.
int SGBucket::get_x | ( | ) | const [inline] |
Definition at line 281 of file newbucket.hxx.
int SGBucket::get_y | ( | ) | const [inline] |
Definition at line 286 of file newbucket.hxx.
void SGBucket::make_bad | ( | ) | [inline] |
Create an impossible bucket.
This is useful if you are comparing cur_bucket to last_bucket and you want to make sure last_bucket starts out as something impossible.
Definition at line 164 of file newbucket.hxx.
void SGBucket::set_bucket | ( | const SGGeod & | geod | ) |
Reset a bucket to represent a new lat and lon.
dlon | longitude specified in degrees | |
dlat | latitude specified in degrees |
Definition at line 136 of file newbucket.cxx.
void SGBucket::set_bucket | ( | double * | lonlat | ) |
Reset a bucket to represent a new lat and lon.
lonlat | an array of double[2] holding lon and lat (specified) in degrees |
Definition at line 80 of file newbucket.cxx.
void SGBucket::set_bucket | ( | double | dlon, | |
double | dlat | |||
) |
Reset a bucket to represent a new lat and lon.
dlon | longitude specified in degrees | |
dlat | latitude specified in degrees |
Definition at line 86 of file newbucket.cxx.
Calculate the offset between two buckets (in quantity of buckets).
b1 | bucket 1 | |
b2 | bucket 2 | |
dx | offset distance (lon) in tile units | |
dy | offset distance (lat) in tile units |
SGBucket sgBucketOffset | ( | double | dlon, | |
double | dlat, | |||
int | x, | |||
int | y | |||
) | [related] |
Return the bucket which is offset from the specified dlon, dlat by the specified tile units in the X & Y direction.
dlon | starting lon in degrees | |
dlat | starting lat in degrees | |
x | number of bucket units to offset in x (lon) direction | |
y | number of bucket units to offset in y (lat) direction |
Definition at line 233 of file newbucket.cxx.