mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
GoogleProjection Class Reference

Web Mercator (EPSG:3857 / Slippy Map) coordinate converter between WGS84 lat/lon and zoom-level pixels. More...

Public Member Functions

 GoogleProjection (int levels=18)
 Precompute Web Mercator projection lookup tables for zoom levels 0 through levels - 1.
void fromLLtoPixel (double &x, double &y, int zoom)
 Project WGS84 (longitude, latitude) in-place to global pixel coordinates (x, y) at zoom.
void fromPixelToLL (double &x, double &y, int zoom)
 Inverse-project global pixel coordinates (x, y) at zoom in-place to WGS84 (longitude, latitude).

Detailed Description

Web Mercator (EPSG:3857 / Slippy Map) coordinate converter between WGS84 lat/lon and zoom-level pixels.

Constructor & Destructor Documentation

◆ GoogleProjection()

GoogleProjection::GoogleProjection ( int levels = 18)
inline

Precompute Web Mercator projection lookup tables for zoom levels 0 through levels - 1.

Parameters
levelsNumber of zoom levels to allocate and precompute (default 18).

Member Function Documentation

◆ fromLLtoPixel()

void GoogleProjection::fromLLtoPixel ( double & x,
double & y,
int zoom )
inline

Project WGS84 (longitude, latitude) in-place to global pixel coordinates (x, y) at zoom.

Parameters
[in,out]xInput longitude in degrees; overwritten with rounded X pixel coordinate.
[in,out]yInput latitude in degrees; overwritten with rounded Y pixel coordinate.
[in]zoomTarget Slippy Map zoom level (0 <= zoom < levels).

◆ fromPixelToLL()

void GoogleProjection::fromPixelToLL ( double & x,
double & y,
int zoom )
inline

Inverse-project global pixel coordinates (x, y) at zoom in-place to WGS84 (longitude, latitude).

Parameters
[in,out]xInput X pixel coordinate; overwritten with longitude in degrees.
[in,out]yInput Y pixel coordinate; overwritten with latitude in degrees.
[in]zoomSource Slippy Map zoom level (0 <= zoom < levels).

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