tilezilla.tilespec module¶
Predefined tile specifications and utilities for working with tile systems
-
class
tilezilla.tilespec.
Tile
(bounds, crs, index, tilespec)[source]¶ Bases:
object
A tile
Parameters: - bounds (BoundingBox) – the bounding box of the tile
- crs (str) – the coordinate reference system of the tile
- index (tuple) – the index of this tile in the larger tile specification
- tilespec (TileSpec) – the tile specification
-
str_format
(s)[source]¶ Return a string .format’d with tile attributes
Parameters: s (s) – A string with format-compatible substitution fields Returns: A formatted string Return type: str
-
geojson
¶ str: This tile’s geometry and crs represented as GeoJSON
-
horizontal
¶ int: The horizontal index of this tile in its tile specification
-
polygon
¶ shapely.geometry.Polygon: This tile’s geometry
-
transform
¶ affine.Affine: The
Affine
transform for the tile
-
vertical
¶ int: The horizontal index of this tile in its tile specification
-
class
tilezilla.tilespec.
TileSpec
(ul, crs, res, size, desc=None)[source]¶ Bases:
object
A tile specification or tile scheme
Parameters: -
bounds_to_tiles
(bounds)[source]¶ Yield Tile objects for this TileSpec that intersect a given bounds
Note
It is required that the input
bounds
be in the same coordinate reference system ascrs
.Parameters: bounds (BoundingBox) – input bounds Yields: Tile – the Tiles that intersect within a bounds
-
-
tilezilla.tilespec.
retrieve_tilespecs
()[source]¶ Retrieve default tile specifications packaged within
tilezilla
Returns: default tilespecs packaged within tilezilla
as TileSpec objectsReturn type: dict
-
tilezilla.tilespec.
TILESPECS
= {'WELD_CONUS': <TileSpec(desc=WELD_CONUS, ul=[-2565600.0, 3314800.0], crs=<Mock name='mock.CRS.from_string()' id='140629125168376'>, res=[30, 30], size=[5000, 5000]) at 0x7fe6c51e9cf8>}¶ dict: Built-in tile specifications available by default