libosmscout  0.1
osmscout::TileId Class Reference

#include <TileId.h>

Public Member Functions

Pixel AsPixel () const
 
GeoBox GetBoundingBox (const Magnification &magnification) const
 Return the bounding box of the given tile. More...
 
GeoBox GetBoundingBox (const MagnificationLevel &level) const
 Return the bounding box of the given tile. More...
 
std::string GetDisplayText () const
 Return a short human readable description of the tile id. More...
 
GeoCoord GetTopLeftCoord (const Magnification &magnification) const
 Return the top left coordinate of the tile. More...
 
uint32_t GetX () const
 Return the X coordinate fo the tile. More...
 
uint32_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 (uint32_t x, uint32_t y)
 Ceate a new tile by passing magnification and tile coordinates. More...
 

Static Public Member Functions

static TileId GetTile (const Magnification &magnification, const GeoCoord &coord)
 Return the libosmscout-specific tile id for the given magnification that contains the given coordinate. More...
 
static TileId GetTile (const MagnificationLevel &level, const GeoCoord &coord)
 Return the libosmscout-specific tile id for the given magnification that contains the given coordinate. 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

◆ TileId()

osmscout::TileId::TileId ( uint32_t  x,
uint32_t  y 
)

Ceate a new tile by passing magnification and tile coordinates.

Member Function Documentation

◆ AsPixel()

Pixel osmscout::TileId::AsPixel ( ) const
inline

◆ GetBoundingBox() [1/2]

GeoBox osmscout::TileId::GetBoundingBox ( const Magnification magnification) const

Return the bounding box of the given tile.

Parameters
magnificationMagnification to complete the definition of the tile id (these are relative to a magnification)
Returns
The GeoBox defining the resulting area

References osmscout::cellDimension, and osmscout::Magnification::GetLevel().

◆ GetBoundingBox() [2/2]

GeoBox osmscout::TileId::GetBoundingBox ( const MagnificationLevel level) const

Return the bounding box of the given tile.

Parameters
magnificationMagnification to complete the definition of the tile id (these are relative to a magnification)
Returns
The GeoBox defining the resulting area

References osmscout::cellDimension, and osmscout::MagnificationLevel::Get().

◆ GetDisplayText()

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

Return a short human readable description of the tile id.

Referenced by osmscout::TileIdBox::GetDisplayText().

◆ GetTile() [1/2]

TileId osmscout::TileId::GetTile ( const Magnification magnification,
const GeoCoord coord 
)
static

Return the libosmscout-specific tile id for the given magnification that contains the given coordinate.

Parameters
magnificationMagnification to use
coordCoordinate that should be covered by the tile
Returns
A tile id

References osmscout::cellDimension, osmscout::GeoCoord::GetLat(), osmscout::Magnification::GetLevel(), and osmscout::GeoCoord::GetLon().

Referenced by osmscout::ElevationService< DataLoader >::ElevationProfile(), osmscout::RouteNodeDataFile::Get(), osmscout::RouteNodeDataFile::GetTile(), osmscout::MapTileCache< T >::GetTilesForBoundingBox(), and osmscout::DataTileCache::GetTilesForBoundingBox().

◆ GetTile() [2/2]

TileId osmscout::TileId::GetTile ( const MagnificationLevel level,
const GeoCoord coord 
)
static

Return the libosmscout-specific tile id for the given magnification that contains the given coordinate.

Parameters
levelLevel to use (magnification.GetLevel())
coordCoordinate that should be covered by the tile
Returns
A tile id

References osmscout::cellDimension, osmscout::MagnificationLevel::Get(), osmscout::GeoCoord::GetLat(), and osmscout::GeoCoord::GetLon().

◆ GetTopLeftCoord()

GeoCoord osmscout::TileId::GetTopLeftCoord ( const Magnification magnification) const

Return the top left coordinate of the tile.

Parameters
magnificationMagnification to complete the definition of the tile id (these are relative to a magnification)
Returns
The resuting coordinate

References osmscout::cellDimension, and osmscout::Magnification::GetLevel().

◆ GetX()

◆ GetY()

◆ operator!=()

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

Compare tile ids for inequality.

◆ operator<()

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

Compare tile ids by their order.

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

◆ operator==()

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

Compare tile ids for equality.


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