Class Tile

Class Documentation

class Tile

This class represents a valid GDAL tile.

Public Functions

Tile(std::shared_ptr<Raster> raster)

Constructor.

Parameters

raster – the raster image for this GDAL tile.

std::pair<bool, double> lookup_datum(double latitude, double longitude) const

Gets the elevation from a GDAL tile.

Parameters
  • latitude – latitude value in degrees

  • longitude – longitude value in degrees

Returns

A pair showing whether an elevation was found (.first) and if true, the elevation in meters above mean sea level (.second).

std::string get_filename() const

Gets the filename of the raster tile that is being accessed.

Returns

The filename.

bool contains(double latitude, double longitude) const

Check if the given coordinates are in the bounds of this tile.

Parameters
  • latitude – latitude value in degrees

  • longitude – longitude value in degrees

Returns

true if the given coordinates are in the tile.

void unload()

Remove the tile data from memory, if cached.

Friends

friend const std::ostream &operator<<(std::ostream &os, const Tile &tile)

Overload insertion operator to print the tile’s data.

Parameters
  • os – the ostream object

  • tile – the tile to print

Returns

The output stream os.