bruty.tile_calculations Module

Functions

test()

g = tile_calculations.TilingScheme(zoom=2); f=g.xy_to_tile; print(f(-100, 40)); print(f(100, -40)); print(f(182, -91)) (0, 2) (3, 1) (4, -1) g.tile_to_xy(0,0, 2) Out[70]: (-180.0, -90.0, -90.0, -45.0) g.tile_to_xy(0,1, 2) Out[71]: (-180.0, -90.0, -45.0, 0.0) g.tile_to_xy(1,1, 2) Out[72]: (-90.0, 0.0, -45.0, 0.0) g.tile_to_xy(2,1, 2) Out[73]: (0.0, 90.0, -45.0, 0.0) g.tile_to_xy(numpy.array([0,1,2]),1, 2) Out[74]: (array([-180., -90., 0.]), array([-90., 0., 90.]), -45.0, 0.0) g.tile_to_xy(numpy.array([0,1,2]),numpy.array([1,0]), 2) Out[75]: (array([-180., -90., 0.]), array([-90., 0., 90.]), array([-45., -90.]), array([ 0., -45.]))

Classes

GoogleTilesLatLon([min_x, min_y, max_x, …])

Use the Lat Lon tiles like TMS but the Y indexing is reversed, visualized at https://www.maptiler.com/google-maps-coordinates-tile-bounds-projection/

GoogleTilesMercator([zoom])

Use the global spherical mercator projection coordinates (EPSG:900913) to match the Google Tile scheme, visualized at https://www.maptiler.com/google-maps-coordinates-tile-bounds-projection/

LatLonTiles([min_x, min_y, max_x, max_y, zoom])

TMSTilesMercator([zoom])

Use the global spherical mercator projection coordinates (EPSG:900913) to match the Google Tile scheme, visualized at https://www.maptiler.com/google-maps-coordinates-tile-bounds-projection/

TilingScheme([min_x, min_y, max_x, max_y, zoom])

A generic coordinate to tile index class.

UTMTiles([zoom])

VABC()