Libosmium  2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
Public Types | Public Member Functions | Public Attributes | List of all members
osmium::geom::Tile Struct Reference

#include <tile.hpp>

Public Types

enum  { max_zoom = 30U }
 

Public Member Functions

 Tile (uint32_t zoom, uint32_t tx, uint32_t ty) noexcept
 
 Tile (uint32_t zoom, const osmium::Location &location)
 
 Tile (uint32_t zoom, const osmium::geom::Coordinates &coordinates)
 
bool valid () const noexcept
 

Public Attributes

uint32_t x
 x coordinate More...
 
uint32_t y
 y coordinate More...
 
uint32_t z
 Zoom level. More...
 

Detailed Description

A tile in the usual Mercator projection.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
max_zoom 

Constructor & Destructor Documentation

◆ Tile() [1/3]

osmium::geom::Tile::Tile ( uint32_t  zoom,
uint32_t  tx,
uint32_t  ty 
)
inlineexplicitnoexcept

Create a tile with the given zoom level and x and y tile coordinates.

The values are not checked for validity.

Precondition
zoom <= 30 && x < 2^zoom && y < 2^zoom
uint32_t x
x coordinate
Definition: tile.hpp:104
uint32_t y
y coordinate
Definition: tile.hpp:107

◆ Tile() [2/3]

osmium::geom::Tile::Tile ( uint32_t  zoom,
const osmium::Location location 
)
inlineexplicit

Create a tile with the given zoom level that contains the given location.

The values are not checked for validity.

Precondition
location.valid() && zoom <= 30

◆ Tile() [3/3]

osmium::geom::Tile::Tile ( uint32_t  zoom,
const osmium::geom::Coordinates coordinates 
)
inlineexplicit

Create a tile with the given zoom level that contains the given coordinates in Mercator projection.

The values are not checked for validity.

Precondition
coordinates.valid() && zoom <= 30

Member Function Documentation

◆ valid()

bool osmium::geom::Tile::valid ( ) const
inlinenoexcept

Check whether this tile is valid. For a tile to be valid the zoom level must be between 0 and 30 and the coordinates must each be between 0 and 2^zoom-1.

Member Data Documentation

◆ x

uint32_t osmium::geom::Tile::x

x coordinate

◆ y

uint32_t osmium::geom::Tile::y

y coordinate

◆ z

uint32_t osmium::geom::Tile::z

Zoom level.


The documentation for this struct was generated from the following file: