Global-Geodetic Profile

This module defines the quantized_mesh_tile.global_geodetic.GlobalGeodetic. Initial code from: https://svn.osgeo.org/gdal/trunk/gdal/swig/python/scripts/gdal2tiles.py Functions necessary for generation of global tiles in Plate Carre projection, EPSG:4326, unprojected profile. Pixel and tile coordinates are in TMS notation (origin [0,0] in bottom-left). What coordinate conversions do we need for TMS Global Geodetic tiles? Global Geodetic tiles are using geodetic coordinates (latitude,longitude) directly as planar coordinates XY (it is also called Unprojected or Plate Carre). We need only scaling to pixel pyramid and cutting to tiles. Pyramid has on top level two tiles, so it is not square but rectangle. Area [-180,-90,180,90] is scaled to 512x256 pixels. TMS has coordinate origin (for pixels and tiles) in bottom-left corner.

Reference

class quantized_mesh_tile.global_geodetic.GlobalGeodetic(tmscompatible, tileSize=256)[source]

Bases: future.types.newobject.newobject

Contructor arguments:

tmscompatible

If set to True, defaults the resolution factor to 0.703125 (2 tiles @ level 0) Adhers to OSGeo TMS spec and therefore Cesium. http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic If set to False, defaults the resolution factor to 1.40625 (1 tile @ level 0) Adheres OpenLayers, MapProxy, etc default resolution for WMTS.

tileSize

The size of the tile in pixel. Default is 256.
GetNumberOfXTilesAtZoom(zoom)[source]

Returns the number of tiles over x at a given zoom level (only 256px)

GetNumberOfYTilesAtZoom(zoom)[source]

Returns the number of tiles over y at a given zoom level (only 256px)

LonLatToPixels(lon, lat, zoom)[source]

Converts lon/lat to pixel coordinates in given zoom of the EPSG:4326 pyramid

LonLatToTile(lon, lat, zoom)[source]

Returns the tile for zoom which covers given lon/lat coordinates

PixelsToTile(px, py)[source]

Returns coordinates of the tile covering region in pixel coordinates

Resolution(arc/pixel) for given zoom level (measured at Equator)[source]
TileBounds(tx, ty, zoom)[source]

Returns bounds of the given tile

TileLatLonBounds(tx, ty, zoom)[source]

Returns bounds of the given tile in the SWNE form

ZoomForPixelSize(pixelSize)[source]

Maximal scaledown zoom of the pyramid closest to the pixelSize.