alaCarte Maps
Renderer for OpenStreetMap tiles
transform.hpp
Go to the documentation of this file.
1 
21 #pragma once
22 #ifndef TRANSFORM_HPP
23 #define TRANSFORM_HPP
24 
25 #include "settings.hpp"
26 
27 #include <utils/point.hpp>
28 
29 void tileToMercator(int tx, int ty, int zoom, coord_t& x, coord_t& y);
30 void mercatorToTile(coord_t x, coord_t y, int zoom, int& tx, int& ty);
31 
32 void projectMercator(const FloatPoint& p, coord_t& x, coord_t& y);
33 void inverseMercator(const FixedPoint& p, double& lat, double& lon);
34 
35 void rot(uint32_t n, FixedPoint& p, bool rx, bool ry);
36 uint64_t xy2hilbert (FixedPoint p);
37 
38 #endif
uint64_t xy2hilbert(FixedPoint p)
Definition: transform.cpp:137
std::int32_t coord_t
Definition: settings.hpp:117
void tileToMercator(int tx, int ty, int zoom, coord_t &x, coord_t &y)
converts tile coordinates to north-west corner of the tile in the Mercator projection.
Definition: transform.cpp:52
void inverseMercator(const FixedPoint &p, double &lat, double &lon)
converts cooridinates in lat/lon (WGS84) to spherical Mercator (EPSG:3857).
Definition: transform.cpp:102
void rot(uint32_t n, FixedPoint &p, bool rx, bool ry)
void projectMercator(const FloatPoint &p, coord_t &x, coord_t &y)
converts cooridinates in lat/lon (WGS84) to spherical Mercator (EPSG:3857).
Definition: transform.cpp:87
void mercatorToTile(coord_t x, coord_t y, int zoom, int &tx, int &ty)
converts mercator coordinates to the coords of the tile they are contained in.
Definition: transform.cpp:73