odc.geo.gridspec.GridSpec

class odc.geo.gridspec.GridSpec(crs, tile_shape, resolution, origin=None, flipx=False, flipy=False)[source]

Definition for a regular spatial grid.

Parameters:
  • crs (Union[str, int, CRS, CRS, Dict[str, Any]]) – Coordinate System used to define the grid

  • tile_shape (Union[Tuple[int, int], XY[int], Shape2d, Index2d]) – Size of each tile in pixels

  • resolution (Union[float, int, Resolution]) – Size of each data point in the grid, in CRS units. Y will usually be negative.

  • origin (Optional[XY[float]]) – Coordinate of a bottom-left corner of the (0,0) tile in CRS units. Default is xy_(0.0, 0.0)

  • flipx (bool) – when True grid index for X axis increments left to right

  • flipy (bool) – when True grid index for Y axis increments top to bottom

__init__(crs, tile_shape, resolution, origin=None, flipx=False, flipy=False)[source]

Methods

__init__(crs, tile_shape, resolution[, ...])

from_sample_tile(box, *[, shape, idx, ...])

Construct odc.geo.gridspec.GridSpec from a sample tile.

geojson(*[, bbox, geopolygon])

Render to GeoJSON.

idx_bounds(bounds)

Convert bounds from CRS to index space.

pt2idx(x, y)

Compute tile index from a point.

tile_geobox(tile_index)

Tile geobox.

tiles(bounds[, geobox_cache])

Query tiles overlapping with bounding box.

tiles_from_geopolygon(geopolygon[, geobox_cache])

Query tiles overlapping with a given polygon.

web_tiles(zoom[, npix])

Construct GridSpec that matches slippy tiles.

Attributes

alignment

Pixel boundary alignment.

dimensions

List of dimension names of the grid spec.

tile_shape

Tile shape in pixels (Y,X order, like numpy).