libosmscout  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
osmscout::TileId Class Reference

A Tile id, uniquely identifing a tile by its level and (unique for the given level) tile coordinates. More...

#include <TileId.h>

Public Member Functions

std::string DisplayText () const
 Return a short human readable description of the tile id. More...
 
const GeoBox & GetBoundingBox () const
 Return the bounding box of the tile. More...
 
size_t GetLevel () const
 Return the zoom level of the tile. More...
 
TileId GetParent () const
 Return the parent tile. More...
 
size_t GetX () const
 Return the X coordinate fo the tile. More...
 
size_t GetY () const
 Return the y coordinate fo the tile. More...
 
bool operator!= (const TileId &other) const
 Compare tile ids for inequality. More...
 
bool operator< (const TileId &other) const
 Compare tile ids by their order. More...
 
bool operator== (const TileId &other) const
 Compare tile ids for equality. More...
 
 TileId (const Magnification &magnification, size_t x, size_t y)
 Ceate a new tile by passing magnification and tile coordinates. More...
 

Detailed Description

A Tile id, uniquely identifing a tile by its level and (unique for the given level) tile coordinates.

Note that this are libosmscout tiles, that evenly split the whole world into - for each level - equaly sized (regarding their latitude and longitude interval) rectangles.

Classic OSM tiles are calculated differently.

Constructor & Destructor Documentation

osmscout::TileId::TileId ( const Magnification magnification,
size_t  x,
size_t  y 
)

Ceate a new tile by passing magnification and tile coordinates.

Referenced by GetParent().

Member Function Documentation

std::string osmscout::TileId::DisplayText ( ) const

Return a short human readable description of the tile id.

References osmscout::NumberToString().

const GeoBox& osmscout::TileId::GetBoundingBox ( ) const
inline

Return the bounding box of the tile.

size_t osmscout::TileId::GetLevel ( ) const
inline

Return the zoom level of the tile.

Referenced by osmscout::DataTileCache::PrefillDataFromCache().

TileId osmscout::TileId::GetParent ( ) const

Return the parent tile.

Note that the parent tile will cover a 4 times bigger region than the current tile.

Note that for tiles with level 0 no parent tile will exist. The method will assert in this case!

References osmscout::Magnification::SetLevel(), and TileId().

Referenced by osmscout::DataTileCache::PrefillDataFromCache().

size_t osmscout::TileId::GetX ( ) const
inline

Return the X coordinate fo the tile.

size_t osmscout::TileId::GetY ( ) const
inline

Return the y coordinate fo the tile.

bool osmscout::TileId::operator!= ( const TileId other) const

Compare tile ids for inequality.

bool osmscout::TileId::operator< ( const TileId other) const

Compare tile ids by their order.

Needed for sorting tile ids and placing them into (some) containers.

bool osmscout::TileId::operator== ( const TileId other) const

Compare tile ids for equality.


The documentation for this class was generated from the following files: