| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
TileGrid
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| bbox, (xs, yz), [(x, y, z), ...] |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
spheroid_a = 6378137.0
|
|||
|
|||
|
stretch_factor allow images to be scaled up by this factor before the next level will be selected |
|||
|
max_shrink_factor allow images to be scaled down by this factor before NoTiles is raised |
|||
|
bbox the bbox of the grid, tiles may overlap this bbox |
|||
|
levels the number of levels |
|||
| RES_TYPE_CUSTOM, RES_TYPE_GLOBAL, RES_TYPE_SQRT2 |
res_type the type of the multi-resolution pyramid. |
||
| SRS |
srs the srs of the grid |
||
| int(with), int(height) |
tile_size the size of each tile in pixel |
||
|
|||
|
Inherited from |
|||
|
|||
>>> grid = TileGrid(epsg=900913) >>> [round(x, 2) for x in grid.bbox] [-20037508.34, -20037508.34, 20037508.34, 20037508.34]
|
Returns the resolution of the >>> grid = TileGrid(epsg=900913) >>> grid.resolution(0) 156543.03392804097 >>> grid.resolution(1) 78271.516964020484 >>> grid.resolution(4) 9783.9396205025605
|
Returns the level index that offers the required resolution. >>> grid = TileGrid(epsg=900913) >>> grid.stretch_factor = 1.1 >>> l1_res = grid.resolution(1) >>> [grid.closest_level(x) for x in (320000.0, 160000.0, l1_res+50, l1_res, l1_res-50, l1_res*0.91, l1_res*0.89, 8000.0)] [0, 0, 1, 1, 1, 1, 2, 5]
|
Flip the tile coord on the y-axis. (Switch between bottom-left and top-left origin.) >>> grid = TileGrid(epsg=900913) >>> grid.flip_tile_coord((0, 1, 1)) (0, 0, 1) >>> grid.flip_tile_coord((1, 3, 2)) (1, 0, 2) |
Get a list with all affected tiles for a bbox and output size. >>> grid = TileGrid() >>> bbox = (-20037508.34, -20037508.34, 20037508.34, 20037508.34) >>> tile_size = (256, 256) >>> grid.get_affected_tiles(bbox, tile_size) ... #doctest: +NORMALIZE_WHITESPACE +ELLIPSIS ((-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244), (1, 1), <generator object ...>)
|
Get a list with all affected tiles for a bbox in the given >>> grid = TileGrid() >>> bbox = (-20037508.34, -20037508.34, 20037508.34, 20037508.34) >>> grid.get_affected_level_tiles(bbox, 0) ... #doctest: +NORMALIZE_WHITESPACE +ELLIPSIS ((-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244), (1, 1), <generator object ...>) |
|
Returns the coordinate of the lower left corner. >>> grid = TileGrid(epsg=900913) >>> [round(x, 2) for x in grid._get_south_west_point((0, 0, 0))] [-20037508.34, -20037508.34] >>> [round(x, 2) for x in grid._get_south_west_point((1, 1, 1))] [0.0, 0.0]
|
Check if the >>> grid = TileGrid(epsg=900913) >>> grid.limit_tile((-1, 0, 2)) == None True >>> grid.limit_tile((1, 2, 1)) == None True >>> grid.limit_tile((1, 2, 2)) (1, 2, 2)
|
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Aug 2 10:24:51 2010 | http://epydoc.sourceforge.net |