libosmscout 0.1
Loading...
Searching...
No Matches
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

Pixel AsPixel () const
GeoBox GetBoundingBox (const Magnification &magnification) const
 Return the bounding box of the given tile.
GeoBox GetBoundingBox (const MagnificationLevel &level) const
 Return the bounding box of the given tile.
std::string GetDisplayText () const
 Return a short human readable description of the tile id.
GeoCoord GetTopLeftCoord (const Magnification &magnification) const
 Return the top left coordinate of the tile.
uint32_t GetX () const
 Return the X coordinate fo the tile.
uint32_t GetY () const
 Return the y coordinate fo the tile.
bool operator!= (const TileId &other) const
 Compare tile ids for inequality.
bool operator< (const TileId &other) const
 Compare tile ids by their order.
bool operator== (const TileId &other) const
 Compare tile ids for equality.
 TileId (uint32_t x, uint32_t y)
 Ceate a new tile by passing magnification and tile coordinates.

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

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.

Referenced by GetTile(), GetTile(), operator!=(), operator<(), and operator==().

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::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::MagnificationLevel::Get().

◆ GetDisplayText()

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

Return a short human readable description of the tile id.

◆ GetTile() [1/2]

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

◆ 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::MagnificationLevel::Get(), osmscout::GeoCoord::GetLat(), osmscout::GeoCoord::GetLon(), and TileId().

◆ 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::Magnification::GetLevel().

◆ GetX()

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

◆ GetY()

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

◆ operator!=()

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

Compare tile ids for inequality.

References TileId().

◆ 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.

References TileId().

◆ operator==()

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

Compare tile ids for equality.

References TileId().


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