|
int | num_tiles_to_cover (int) const |
| Compute how many tiles are needed to cover X number of meters. More...
|
|
| DOrthoQuad (unsigned edge_length_pix=0) |
| Construct a digital orthoquad image buffer; must be square. More...
|
|
int | fill (const pt &) |
| Fill the array with image data roughly around a given point. More...
|
|
int | refill (const pt &) |
| Like fill(), but force a download from the internet. More...
|
|
char | select_tileset (char) |
| change the tileset "theme" – see themes in lib/topo/master.h More...
|
|
long | left () const |
| Return the "easting" coordinate of the left edge of the DOQ. More...
|
|
long | top () const |
| Return the "northing" coordinate of the top edge of the DOQ. More...
|
|
char | zone () const |
| return UTM zone for the DOQ (which must lie entirely in a zone). More...
|
|
size_t | width () const |
| Return the east-west size of the image, in meters. More...
|
|
size_t | height () const |
| Return the north-south size of the image, in meters. More...
|
|
bool | isReady () const |
| Returns true iff the array has been filled with image data. More...
|
|
int | as_matrix (Int_matrix *) const |
| represent DOQ as a matrix of integers: row 0, col 0 is northwest More...
|
|
kjb_c::Pixel | read_color (unsigned, unsigned) const |
| Read pixel RELATIVE TO current left,top settings (meters offset) More...
|
|
kjb_c::Pixel | read_abs_color (long, long) const |
| Return color pixel at given UTM coordinates (zone assumed) More...
|
|
Pixel | read (unsigned, unsigned) const |
| Read pixel RELATIVE TO current left,top settings (meters offset) More...
|
|
Pixel | read_abs (long, long) const |
| Return pixel at given UTM coordinates (zone assumed) More...
|
|
Pixel | read_abs (const pt &) const |
| Return pixel at given UTM coordinates. More...
|
|
pt | center () const |
| Return UTM coordinates of the center of the DOQ. More...
|
|
const kjb::Image & | debug_access_internal_image_buffer () const |
| access internal buffer, but with clunky name to discourage you More...
|
|
float | meters_per_pixel () const |
| retrieve the number of meters per pixel for chosen imagery theme More...
|
|
Digital orthoquad buffer.
This class lets you build grayscale digital orthoquad images. You choose the size, and then you can "fill" it centered at a given UTM coordinate. This downloads the data for you; then you can read pixels out of the buffer at will. The "fill" process queries an on-disk cache, and if any desired tiles are absent, it will request the missing tiles over the internets.
Centering is approximate. There is a granularity of about 200 pixels; the resulting image can have an offset of about plus or minus 100 pixels in each direction. The best way to cope with centering jitter is to use the read_abs() method to read pixels into a matrix, instead of the as_matrix method.
Default tileset: aerial imagery at 1 meter per pixel resolution, i.e., the tileset coded AIR_1M in header file lib/topo/master.h. You can change the tileset with the select_tileset() method. This is a new method, and much of the code and documentation assumes a 1 meter per pixel resolution. But many other tilesets have a different resolution, and so the code might not work as expected or the documentation might be wrong for such tilesets. It is a (low-priority) work in progress to make the code and documentation consistent with the recent possibility for other resolutions.
int kjb::TopoFusion::DOrthoQuad::fill |
( |
const pt & |
center | ) |
|
Fill the array with image data roughly around a given point.
Use fill() under ordinary circumstances, since it will make use of locally cached results.
3 Dec 2010: It's unbelievable that I'm only discovering this after 2 years working with this code, but I now think the resulting image is only ROUGHLY centered on the given location, with a granularity of one "tile" (an internal unit of image tranfer that I thought was encapsulated so that you, the client, would never have to know about it). A tile, at this writing, is 200 x 200 pixels, so the filled image could, I think, be offset from your specified center by plus or minus 100 pixels, in either axis.
Use the read_abs() method to avoid the above granularity.
- Returns
- ERROR or NO_ERROR indicating outcome.