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 gridtile_shape (
Union
[Tuple
[int
,int
],XY
[int
],Shape2d
,Index2d
]) – Size of each tile in pixelsresolution (
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 isxy_(0.0, 0.0)
flipx (
bool
) – whenTrue
grid index for X axis increments left to rightflipy (
bool
) – whenTrue
grid index for Y axis increments top to bottom
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
Pixel boundary alignment.
List of dimension names of the grid spec.
Tile shape in pixels (Y,X order, like numpy).